From 7f08e6c6f88a838d4ab367c2bf22c4be184bda86 Mon Sep 17 00:00:00 2001 From: JKingsnorth Date: Mon, 4 Jan 2016 10:59:24 +0000 Subject: [PATCH] Add webtest for maximum participants configurable per event --- tests/phpunit/WebTest/Event/AddEventTest.php | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index 4bc14c0506..f87acc478c 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -1202,4 +1202,31 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; $this->assertElementContainsText("xpath=//div[@id='participantSearch']/table/tbody/tr[@id='rowid$newParticipantId']/td[9]", "Cancelled (test)"); } + /** + * CRM-17745: Make maximum number of participants configurable + */ + public function testLimitMaximumParticipants() { + $this->webtestLogin('admin'); + + // Add event + $this->openCiviPage("event/add", "reset=1&action=add"); + $eventTitle = 'My Conference - ' . substr(sha1(rand()), 0, 7); + $eventDescription = "Here is a description for this conference."; + $registerIntro = "Fill in all the fields below and click Continue."; + $this->_testAddEventInfo($eventTitle, $eventDescription); + $multipleRegistrations = TRUE; + $this->_testAddOnlineRegistration($registerIntro, $multipleRegistrations); + $id = $this->urlArg('id'); + + // Limit additional participants + $this->openCiviPage("event/manage/registration", "reset=1&action=update&id=$id", '_qf_Registration_upload-bottom'); + $this->select("max_additional_participants", "value=4"); + $this->click("_qf_Registration_upload-bottom"); + $this->waitForText('crm-notification-container', "'Online Registration' information has been saved."); + + // Open registration page and check maximum participants + $this->openCiviPage("event/register", "reset=1&id=$id&action=preview", '_qf_Register_upload-bottom'); + $this->verifyText("xpath=//select[@id='additional_participants']/option[last()]", 5); + } + } -- 2.25.1