From 46ff77042b5f9778d1d2f64ebefba97482def495 Mon Sep 17 00:00:00 2001 From: Luke Renfrew Date: Fri, 19 Feb 2021 15:08:07 +0000 Subject: [PATCH] Update to PHPunit 9 and a PHP8 support --- composer.json | 6 +- phpunit.xml | 2 +- tests/ConfigTest.php | 338 ++++++++++++++++++++++++++++--------------- 3 files changed, 227 insertions(+), 119 deletions(-) diff --git a/composer.json b/composer.json index 960fddf..6d06ac2 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,11 @@ } ], "require": { - "php": ">=5.3.0", - "beberlei/assert": "2.3" + "php": ">=7.3", + "beberlei/assert": "^3.3" }, "require-dev": { - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "9.*", "squizlabs/php_codesniffer": "1.*" }, "autoload": { diff --git a/phpunit.xml b/phpunit.xml index a9f8234..1e277aa 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,7 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" + > diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 4a58634..844b3bd 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -3,11 +3,11 @@ use GatherContent\ConfigValueObject\Config; use GatherContent\ConfigValueObject\ConfigValueException; -class ConfigTest extends PHPUnit_Framework_TestCase +class ConfigTest extends \PHPUnit\Framework\TestCase { private $fullConfig; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -276,7 +276,8 @@ public function testCreatingFromJson() public function testEmptyConfig() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Config must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Config must not be empty'); $json = '[]'; @@ -285,7 +286,8 @@ public function testEmptyConfig() public function testRandomArray() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab must be an object'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab must be an object'); $json = '["a","s","d","f"]'; @@ -294,7 +296,8 @@ public function testRandomArray() public function testString() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Config must be array'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Config must be array'); $string = 'asdf'; @@ -303,7 +306,8 @@ public function testString() public function testMissingLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab label attribute is required'); unset($this->fullConfig[0]->label); @@ -312,7 +316,8 @@ public function testMissingLabel() public function testMissingName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab name attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab name attribute is required'); unset($this->fullConfig[0]->name); @@ -321,7 +326,8 @@ public function testMissingName() public function testMissingHidden() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab hidden attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab hidden attribute is required'); unset($this->fullConfig[0]->hidden); @@ -330,7 +336,8 @@ public function testMissingHidden() public function testMissingElements() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab elements attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab elements attribute is required'); unset($this->fullConfig[0]->elements); @@ -339,7 +346,8 @@ public function testMissingElements() public function testAdditionalAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab must not have additional attributes'); $this->fullConfig[0]->this = 'shouldn\'t be here'; @@ -348,7 +356,8 @@ public function testAdditionalAttribute() public function testInvalidLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab label attribute must be string'); $this->fullConfig[0]->label = true; @@ -357,7 +366,8 @@ public function testInvalidLabel() public function testInvalidName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab name attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab name attribute must be string'); $this->fullConfig[0]->name = false; @@ -366,7 +376,8 @@ public function testInvalidName() public function testInvalidHidden() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab hidden attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab hidden attribute must be boolean'); $this->fullConfig[0]->hidden = 'false'; @@ -375,7 +386,8 @@ public function testInvalidHidden() public function testInvalidElements() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab elements attribute must be array'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab elements attribute must be array'); $this->fullConfig[0]->elements = 'none'; @@ -384,7 +396,8 @@ public function testInvalidElements() public function testEmptyLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab label attribute must not be empty'); $this->fullConfig[0]->label = ''; @@ -393,7 +406,8 @@ public function testEmptyLabel() public function testEmptyName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab name attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab name attribute must not be empty'); $this->fullConfig[0]->name = ''; @@ -402,7 +416,8 @@ public function testEmptyName() public function testNonUniqueTabNames() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Tab names must be unique'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Tab names must be unique'); $this->fullConfig[0]->name = 'tab1'; $this->fullConfig[1]->name = 'tab1'; @@ -412,7 +427,8 @@ public function testNonUniqueTabNames() public function testRandomElements() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must be an object'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must be an object'); $this->fullConfig[0]->elements = array('a', 's', 'd', 'f'); @@ -421,7 +437,8 @@ public function testRandomElements() public function testMissingElementType() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element type attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element type attribute is required'); unset($this->fullConfig[0]->elements[0]->type); @@ -430,7 +447,8 @@ public function testMissingElementType() public function testMissingElementName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element name attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element name attribute is required'); unset($this->fullConfig[0]->elements[0]->name); @@ -439,7 +457,8 @@ public function testMissingElementName() public function testInvalidElementType1() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element type attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element type attribute must be string'); $this->fullConfig[0]->elements[0]->type = true; @@ -448,7 +467,8 @@ public function testInvalidElementType1() public function testInvalidElementType2() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must be of a supported type'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must be of a supported type'); $this->fullConfig[0]->elements[0]->type = 'asdf'; @@ -457,7 +477,8 @@ public function testInvalidElementType2() public function testInvalidElementName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element name attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element name attribute must be string'); $this->fullConfig[0]->elements[0]->name = 12345; @@ -466,7 +487,8 @@ public function testInvalidElementName() public function testEmptyElementName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element name attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element name attribute must not be empty'); $this->fullConfig[0]->elements[0]->name = ''; @@ -475,7 +497,8 @@ public function testEmptyElementName() public function testMissingTextRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -486,7 +509,8 @@ public function testMissingTextRequired() public function testMissingTextLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -497,7 +521,8 @@ public function testMissingTextLabel() public function testMissingTextValue() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element value attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element value attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -508,7 +533,8 @@ public function testMissingTextValue() public function testMissingTextMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -519,7 +545,8 @@ public function testMissingTextMicrocopy() public function testMissingTextLimitType() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit_type attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit_type attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -530,7 +557,8 @@ public function testMissingTextLimitType() public function testMissingTextLimit() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -541,7 +569,8 @@ public function testMissingTextLimit() public function testMissingTextPlainText() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element plain_text attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element plain_text attribute is required'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -552,7 +581,8 @@ public function testMissingTextPlainText() public function testAdditionalTextAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must not have additional attributes'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -563,7 +593,8 @@ public function testAdditionalTextAttribute() public function testInvalidTextRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute must be boolean'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -574,7 +605,8 @@ public function testInvalidTextRequired() public function testInvalidTextLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must be string'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -585,7 +617,8 @@ public function testInvalidTextLabel() public function testInvalidTextValue() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element value attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element value attribute must be string'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -596,7 +629,8 @@ public function testInvalidTextValue() public function testInvalidTextMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute must be string'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -607,7 +641,8 @@ public function testInvalidTextMicrocopy() public function testInvalidTextLimitType() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit_type attribute value must be either "words" or "chars"'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit_type attribute value must be either "words" or "chars"'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -618,7 +653,8 @@ public function testInvalidTextLimitType() public function testInvalidTextLimit1() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit attribute must be integer'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit attribute must be integer'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -629,7 +665,8 @@ public function testInvalidTextLimit1() public function testInvalidTextLimit2() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit attribute must not be negative'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit attribute must not be negative'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -640,7 +677,8 @@ public function testInvalidTextLimit2() public function testInvalidTextLimit3() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit attribute must be integer'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit attribute must be integer'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -651,7 +689,8 @@ public function testInvalidTextLimit3() public function testInvalidTextLimit4() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element limit attribute must be integer'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element limit attribute must be integer'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -662,7 +701,8 @@ public function testInvalidTextLimit4() public function testInvalidTextPlainText() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element plain_text attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element plain_text attribute must be boolean'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -673,7 +713,8 @@ public function testInvalidTextPlainText() public function testEmptyTextLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must not be empty'); $this->assertEquals('text', $this->fullConfig[0]->elements[0]->type); @@ -684,7 +725,8 @@ public function testEmptyTextLabel() public function testMissingFilesRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute is required'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -695,7 +737,8 @@ public function testMissingFilesRequired() public function testMissingFilesLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute is required'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -706,7 +749,8 @@ public function testMissingFilesLabel() public function testMissingFilesMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute is required'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -717,7 +761,8 @@ public function testMissingFilesMicrocopy() public function testAdditionalFilesAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must not have additional attributes'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -728,7 +773,8 @@ public function testAdditionalFilesAttribute() public function testInvalidFilesRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute must be boolean'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -739,7 +785,8 @@ public function testInvalidFilesRequired() public function testInvalidFilesLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must be string'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -750,7 +797,8 @@ public function testInvalidFilesLabel() public function testInvalidFilesMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute must be string'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -761,7 +809,8 @@ public function testInvalidFilesMicrocopy() public function testEmptyFilesLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must not be empty'); $this->assertEquals('files', $this->fullConfig[0]->elements[2]->type); @@ -772,7 +821,8 @@ public function testEmptyFilesLabel() public function testMissingSectionTitle() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element title attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element title attribute is required'); $this->assertEquals('section', $this->fullConfig[0]->elements[3]->type); @@ -783,7 +833,8 @@ public function testMissingSectionTitle() public function testMissingSectionSubtitle() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element subtitle attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element subtitle attribute is required'); $this->assertEquals('section', $this->fullConfig[0]->elements[3]->type); @@ -794,7 +845,8 @@ public function testMissingSectionSubtitle() public function testAdditionalSectionAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must not have additional attributes'); $this->assertEquals('section', $this->fullConfig[0]->elements[3]->type); @@ -805,7 +857,8 @@ public function testAdditionalSectionAttribute() public function testInvalidSectionTitle() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element title attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element title attribute must be string'); $this->assertEquals('section', $this->fullConfig[0]->elements[3]->type); @@ -816,7 +869,8 @@ public function testInvalidSectionTitle() public function testInvalidSectionSubtitle() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element subtitle attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element subtitle attribute must be string'); $this->assertEquals('section', $this->fullConfig[0]->elements[3]->type); @@ -827,7 +881,8 @@ public function testInvalidSectionSubtitle() public function testEmptySectionTitle() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element title attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element title attribute must not be empty'); $this->assertEquals('section', $this->fullConfig[0]->elements[3]->type); @@ -838,7 +893,8 @@ public function testEmptySectionTitle() public function testMissingChoiceRadioRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -849,7 +905,8 @@ public function testMissingChoiceRadioRequired() public function testMissingChoiceRadioLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -860,7 +917,8 @@ public function testMissingChoiceRadioLabel() public function testMissingChoiceRadioMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -871,7 +929,8 @@ public function testMissingChoiceRadioMicrocopy() public function testMissingChoiceRadioOtherOption() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element other_option attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element other_option attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -882,7 +941,8 @@ public function testMissingChoiceRadioOtherOption() public function testMissingChoiceRadioOptions() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element options attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element options attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -893,7 +953,8 @@ public function testMissingChoiceRadioOptions() public function testMissingChoiceRadioOptionName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option name attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option name attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -904,7 +965,8 @@ public function testMissingChoiceRadioOptionName() public function testMissingChoiceRadioOptionLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -915,7 +977,8 @@ public function testMissingChoiceRadioOptionLabel() public function testMissingChoiceRadioOptionSelected() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option selected attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option selected attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -926,7 +989,8 @@ public function testMissingChoiceRadioOptionSelected() public function testAdditionalChoiceRadioAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must not have additional attributes'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -937,7 +1001,8 @@ public function testAdditionalChoiceRadioAttribute() public function testAdditionalChoiceRadioOptionAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must not have additional attributes'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -948,7 +1013,8 @@ public function testAdditionalChoiceRadioOptionAttribute() public function testAdditionalChoiceRadioOtherOptionAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must not have additional attributes'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); $this->assertTrue($this->fullConfig[1]->elements[1]->other_option); @@ -960,7 +1026,8 @@ public function testAdditionalChoiceRadioOtherOptionAttribute() public function testInvalidChoiceRadioRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute must be boolean'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -971,7 +1038,8 @@ public function testInvalidChoiceRadioRequired() public function testInvalidChoiceRadioLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must be string'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -982,7 +1050,8 @@ public function testInvalidChoiceRadioLabel() public function testInvalidChoiceRadioMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute must be string'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -993,7 +1062,8 @@ public function testInvalidChoiceRadioMicrocopy() public function testInvalidChoiceRadioOtherOption() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element other_option attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element other_option attribute must be boolean'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1004,7 +1074,8 @@ public function testInvalidChoiceRadioOtherOption() public function testInvalidChoiceRadioOptions() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element options attribute must be array'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element options attribute must be array'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1015,7 +1086,8 @@ public function testInvalidChoiceRadioOptions() public function testEmptyChoiceRadioLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must not be empty'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1026,7 +1098,8 @@ public function testEmptyChoiceRadioLabel() public function testInvalidChoiceRadioOptionName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option name attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option name attribute must be string'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1037,7 +1110,8 @@ public function testInvalidChoiceRadioOptionName() public function testInvalidChoiceRadioOptionLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute must be string'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1048,7 +1122,8 @@ public function testInvalidChoiceRadioOptionLabel() public function testInvalidChoiceRadioOptionSelected() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option selected attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option selected attribute must be boolean'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1059,7 +1134,8 @@ public function testInvalidChoiceRadioOptionSelected() public function testInvalidChoiceRadioOptionValues() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option value attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option value attribute must be string'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); $this->assertTrue($this->fullConfig[1]->elements[1]->other_option); @@ -1071,7 +1147,8 @@ public function testInvalidChoiceRadioOptionValues() public function testMissingChoiceCheckboxRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1082,7 +1159,8 @@ public function testMissingChoiceCheckboxRequired() public function testMissingChoiceCheckboxLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1093,7 +1171,8 @@ public function testMissingChoiceCheckboxLabel() public function testMissingChoiceCheckboxMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1104,7 +1183,8 @@ public function testMissingChoiceCheckboxMicrocopy() public function testMissingChoiceCheckboxOptions() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element options attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element options attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1115,7 +1195,8 @@ public function testMissingChoiceCheckboxOptions() public function testMissingChoiceCheckboxOptionName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option name attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option name attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1126,7 +1207,8 @@ public function testMissingChoiceCheckboxOptionName() public function testMissingChoiceCheckboxOptionLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1137,7 +1219,8 @@ public function testMissingChoiceCheckboxOptionLabel() public function testMissingChoiceCheckboxOptionSelected() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option selected attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option selected attribute is required'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1148,7 +1231,8 @@ public function testMissingChoiceCheckboxOptionSelected() public function testAdditionalChoiceCheckboxAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must not have additional attributes'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1159,7 +1243,8 @@ public function testAdditionalChoiceCheckboxAttribute() public function testAdditionalChoiceCheckboxOptionAttribute() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must not have additional attributes'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1170,7 +1255,8 @@ public function testAdditionalChoiceCheckboxOptionAttribute() public function testInvalidChoiceCheckboxRequired() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element required attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element required attribute must be boolean'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1181,7 +1267,8 @@ public function testInvalidChoiceCheckboxRequired() public function testInvalidChoiceCheckboxLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must be string'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1192,7 +1279,8 @@ public function testInvalidChoiceCheckboxLabel() public function testInvalidChoiceCheckboxMicrocopy() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element microcopy attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element microcopy attribute must be string'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1203,7 +1291,8 @@ public function testInvalidChoiceCheckboxMicrocopy() public function testInvalidChoiceCheckboxOptions() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element options attribute must be array'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element options attribute must be array'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1213,19 +1302,21 @@ public function testInvalidChoiceCheckboxOptions() } public function testEmptyChoiceCheckboxLabel() - { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element label attribute must not be empty'); + { + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element label attribute must not be empty'); - $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); + $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); - $this->fullConfig[1]->elements[3]->label = ''; + $this->fullConfig[1]->elements[3]->label = ''; - new Config($this->fullConfig); - } + new Config($this->fullConfig); + } public function testInvalidChoiceCheckboxOptionName() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option name attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option name attribute must be string'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1236,7 +1327,8 @@ public function testInvalidChoiceCheckboxOptionName() public function testInvalidChoiceCheckboxOptionLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute must be string'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute must be string'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1247,7 +1339,8 @@ public function testInvalidChoiceCheckboxOptionLabel() public function testInvalidChoiceCheckboxOptionSelected() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option selected attribute must be boolean'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option selected attribute must be boolean'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1258,7 +1351,8 @@ public function testInvalidChoiceCheckboxOptionSelected() public function testEmptyChoiceCheckboxOptionLabel() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute must not be empty'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1269,7 +1363,8 @@ public function testEmptyChoiceCheckboxOptionLabel() public function testNonUniqueElementNames() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element names must be unique'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element names must be unique'); $this->fullConfig[0]->elements[0]->name = 'el12345'; $this->fullConfig[0]->elements[1]->name = 'el12345'; @@ -1279,7 +1374,8 @@ public function testNonUniqueElementNames() public function testNonUniqueOptionNames() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option names must be unique'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option names must be unique'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1301,7 +1397,8 @@ public function testOptionNamesAreAllowedToBeReusedAccrossElements() public function testNoOptionsForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must have at least one option'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must have at least one option'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1312,7 +1409,8 @@ public function testNoOptionsForChoiceRadio() public function testNoOptionsForChoiceCheckbox() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element must have at least one option'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element must have at least one option'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1323,7 +1421,8 @@ public function testNoOptionsForChoiceCheckbox() public function testNonObjectOptionForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must be an object'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must be an object'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1334,7 +1433,8 @@ public function testNonObjectOptionForChoiceRadio() public function testNonObjectOptionForChoiceCheckbox() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must be an object'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must be an object'); $this->assertEquals('choice_checkbox', $this->fullConfig[1]->elements[3]->type); @@ -1345,7 +1445,8 @@ public function testNonObjectOptionForChoiceCheckbox() public function testMultipleOptionsSelectedForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Element choice_radio must have at most one option selected'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Element choice_radio must have at most one option selected'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); @@ -1357,7 +1458,8 @@ public function testMultipleOptionsSelectedForChoiceRadio() public function testMissingOtherOptionValueForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option value attribute is required'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option value attribute is required'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); @@ -1368,7 +1470,8 @@ public function testMissingOtherOptionValueForChoiceRadio() public function testUnnecessaryOptionValueForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must not have additional attributes'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); $this->assertFalse($this->fullConfig[1]->elements[0]->other_option); @@ -1380,7 +1483,8 @@ public function testUnnecessaryOptionValueForChoiceRadio() public function testOtherOptionValueOnOtherThanLastOptionForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option must not have additional attributes'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option must not have additional attributes'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); $this->assertTrue($this->fullConfig[1]->elements[1]->other_option); @@ -1392,7 +1496,8 @@ public function testOtherOptionValueOnOtherThanLastOptionForChoiceRadio() public function testEmptyOptionLabelForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute must not be empty'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[0]->type); $this->assertFalse($this->fullConfig[1]->elements[0]->other_option); @@ -1404,7 +1509,8 @@ public function testEmptyOptionLabelForChoiceRadio() public function testEmptyOtherOptionLabelForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Option label attribute must not be empty'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Option label attribute must not be empty'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); $this->assertTrue($this->fullConfig[1]->elements[1]->other_option); @@ -1417,7 +1523,8 @@ public function testEmptyOtherOptionLabelForChoiceRadio() public function testOtherOptionValueEmptyIfOtherOptionNotSelectedForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Other option value must be empty when other option not selected'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Other option value must be empty when other option not selected'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); $this->assertEquals(3, count($this->fullConfig[1]->elements[1]->options)); @@ -1431,7 +1538,8 @@ public function testOtherOptionValueEmptyIfOtherOptionNotSelectedForChoiceRadio( public function testOtherOptionMustNotBeTheOnlyOptionForChoiceRadio() { - $this->setExpectedException('GatherContent\ConfigValueObject\ConfigValueException', 'Other option must not be the only option'); + $this->expectException('GatherContent\ConfigValueObject\ConfigValueException'); + $this->expectExceptionMessage('Other option must not be the only option'); $this->assertEquals('choice_radio', $this->fullConfig[1]->elements[1]->type); $this->assertTrue($this->fullConfig[1]->elements[1]->other_option);