Skip to content
Snippets Groups Projects
Commit 4818fad6 authored by Lachezar Lechev's avatar Lachezar Lechev
Browse files

Tests - Utils - UtilsNonEmptyString - add additional test for new method

parent cc9d3f3c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -32,4 +32,46 @@ class UtilsNonEmptyStringTest extends ProvidersTestCase
{
$this->assertFalse(Utils::nonEmptyString($badTypes));
}
/**
* @dataProvider iterableWithStrings
*
* @param \Traversable|string[] $iterable
*/
public function testNonEmptyStringInArrayWithValidTraversableWithStrings($iterable)
{
$this->assertTrue(Utils::nonEmptyStringInArray($iterable[0], $iterable));
}
/**
* @dataProvider iterableInArrayWithBadData
*
* @param \Traversable|string[] $iterable
* @param string $nonExistingString
*/
public function testNonEmptyStringInArrayWithBadData($iterable, $nonExistingString)
{
$this->assertFalse(Utils::nonEmptyStringInArray($nonExistingString, $iterable));
}
/**
* @dataProvider iterableInArrayWithGoodData
*
* @param \Traversable|string[] $iterable
*/
public function testCheckIfInArrayForValueWithGoodData($iterable)
{
$this->assertTrue(Utils::checkInArrayForValue($iterable[1], $iterable));
}
/**
* @dataProvider iterableInArrayWithBadData
*
* @param \Traversable|string[] $iterable
* @param mixed $valueToCheck
*/
public function testCheckIfInArrayForValueWithBadData($iterable, $valueToCheck)
{
$this->assertFalse(Utils::checkInArrayForValue($valueToCheck, $iterable));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment