diff --git a/test/BaseInputFilterTest.php b/test/BaseInputFilterTest.php index f4618769..2ff4a16a 100644 --- a/test/BaseInputFilterTest.php +++ b/test/BaseInputFilterTest.php @@ -187,6 +187,10 @@ public function dataSets() */ public function testCanValidateEntireDataset($dataset, $expected) { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $filter->setData($dataset); $this->assertSame($expected, $filter->isValid()); @@ -194,6 +198,10 @@ public function testCanValidateEntireDataset($dataset, $expected) public function testCanValidatePartialDataset() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $validData = array( 'foo' => ' bazbat ', @@ -217,6 +225,10 @@ public function testCanValidatePartialDataset() public function testCanRetrieveInvalidInputsOnFailedValidation() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $invalidData = array( 'foo' => ' bazbat ', @@ -242,6 +254,10 @@ public function testCanRetrieveInvalidInputsOnFailedValidation() public function testCanRetrieveValidInputsOnFailedValidation() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $invalidData = array( 'foo' => ' bazbat ', @@ -268,6 +284,10 @@ public function testCanRetrieveValidInputsOnFailedValidation() public function testValuesRetrievedAreFiltered() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $validData = array( 'foo' => ' bazbat ', @@ -296,6 +316,10 @@ public function testValuesRetrievedAreFiltered() public function testCanGetRawInputValues() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $validData = array( 'foo' => ' bazbat ', @@ -315,6 +339,10 @@ public function testCanGetRawInputValues() public function testCanGetValidationMessages() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $filter->get('baz')->setRequired(true); $filter->get('nest')->get('baz')->setRequired(true); @@ -621,6 +649,10 @@ public function testValidationMarksInputValidWhenAllowEmptyFlagIsTrueAndContinue public function testCanRetrieveRawValuesIndividuallyWithoutValidating() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $data = array( 'foo' => ' bazbat ', @@ -637,6 +669,10 @@ public function testCanRetrieveRawValuesIndividuallyWithoutValidating() public function testCanRetrieveUnvalidatedButFilteredInputValue() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $data = array( 'foo' => ' baz 2 bat ', @@ -671,6 +707,10 @@ public function testGetRequiredNotEmptyValidationMessages() } public function testHasUnknown() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $validData = array( 'foo' => ' bazbat ', @@ -691,6 +731,10 @@ public function testHasUnknown() } public function testGetUknown() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $filter = $this->getInputFilter(); $unknown = array( 'bar' => '12345', diff --git a/test/CollectionInputFilterTest.php b/test/CollectionInputFilterTest.php index a407537e..03e29aa9 100644 --- a/test/CollectionInputFilterTest.php +++ b/test/CollectionInputFilterTest.php @@ -111,6 +111,10 @@ public function testSetInputFilter() public function testInputFilterInputsAppliedToCollection() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $this->filter->setInputFilter($this->getBaseInputFilter()); $this->assertCount(4, $this->filter->getInputs()); @@ -158,6 +162,10 @@ public function testGetCountUsesSpecifiedCount() public function testCanValidateValidData() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $this->filter->setInputFilter($this->getBaseInputFilter()); $this->filter->setData($this->getValidCollectionData()); $this->assertTrue($this->filter->isValid()); @@ -165,6 +173,10 @@ public function testCanValidateValidData() public function testCanValidateValidDataWithNonConsecutiveKeys() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $collectionData = $this->getValidCollectionData(); $collectionData[2] = $collectionData[0]; unset($collectionData[0]); @@ -175,6 +187,10 @@ public function testCanValidateValidDataWithNonConsecutiveKeys() public function testInvalidDataReturnsFalse() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $invalidCollectionData = array( array( 'foo' => ' bazbatlong ', @@ -195,6 +211,10 @@ public function testInvalidDataReturnsFalse() public function testDataLessThanCountIsInvalid() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $invalidCollectionData = array( array( 'foo' => ' bazbat ', @@ -216,6 +236,10 @@ public function testDataLessThanCountIsInvalid() public function testGetValues() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $expectedData = array( array( 'foo' => 'bazbat', @@ -253,6 +277,10 @@ public function testGetValues() public function testGetRawValues() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $expectedData = array( array( 'foo' => ' bazbat ', @@ -285,6 +313,10 @@ public function testGetRawValues() public function testGetMessagesForInvalidInputs() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $invalidCollectionData = array( array( 'foo' => ' bazbattoolong ', @@ -327,6 +359,10 @@ public function testGetMessagesForInvalidInputs() public function testSetValidationGroupUsingFormStyle() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + // forms set an array of identical validation groups for each set of data $formValidationGroup = array( array( @@ -367,6 +403,10 @@ public function testSetValidationGroupUsingFormStyle() public function testEmptyCollectionIsValidByDefault() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $data = array(); $this->filter->setInputFilter($this->getBaseInputFilter()); @@ -377,6 +417,10 @@ public function testEmptyCollectionIsValidByDefault() public function testEmptyCollectionIsNotValidIfRequired() { + if (!extension_loaded('intl')) { + $this->markTestSkipped('ext/intl not enabled'); + } + $data = array(); $this->filter->setInputFilter($this->getBaseInputFilter());