Method | Description | |
---|---|---|
that ( mixed $subject ) : |
Fluent custom primitives' and objects' assertion to simplify your tests. | |
thatArray ( array $actual ) : |
Fluent custom array assertion to simplify your tests. | |
thatBool ( string $string ) : |
Fluent custom boolean assertion to simplify your tests. | |
thatModel ( |
Fluent custom model assertion to simplify your tests. | |
thatSession ( ) | Fluent custom session assertion to simplify your tests. | |
thatString ( string $string ) : Ouzo\Tests\StringAssert | Fluent custom string assertion to simplify your tests. |
Assert::that($object)->isInstanceOf(Controller::class);
$animals = array('cat', 'dog', 'pig');
Assert::thatArray($animals)->hasSize(3)->contains('cat');
Assert::thatArray($animals)->containsOnly('pig', 'dog', 'cat');
Assert::thatArray($animals)->containsExactly('cat', 'dog', 'pig');
Assert::thatArray(array('id' => 123, 'name' => 'john'))->containsKeyAndValue(array('id' => 123));
Assert::thatBool(isCool())->isTrue();
Assert::thatModel(new User(['name' => 'bob']))->hasSameAttributesAs(new User(['name' => 'bob']));
public static thatModel ( |
||
$actual | ||
return |
Session::push('key1', 'key2', 'value1');
Assert::thatSession()->hasSize(1)->contains('value1');
Class Assert public static thatSession ( ) |
Assert::thatString("Frodo")->startsWith("Fro")->endsWith("do")->contains("rod")->doesNotContain("fro")->hasSize(5)->matches('/Fro\w+/');
public static thatString ( string $string ) : Ouzo\Tests\StringAssert | ||
$string | string | |
return | Ouzo\Tests\StringAssert |