for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Pitchart\Phlunit;
use PHPUnit\Framework\TestCase;
final class Expect
{
/**
* @var TestCase
*/
private $testCase;
* Expect constructor.
*
* @param TestCase $testCase
private function __construct(TestCase $testCase)
$this->testCase = $testCase;
}
public static function after(TestCase $testCase)
return new self($testCase);
public function anException(string $class = \Exception::class): self
$this->testCase->expectException($class);
return $this;
public function describedBy(string $message): self
$this->testCase->expectExceptionMessage($message);
public function havingCode(int $code): self
$this->testCase->expectExceptionCode($code);
public function aDeprecation(): self
$this->testCase->expectDeprecation();
public function aNotice(): self
$this->testCase->expectNotice();
public function aWarning(): self
$this->testCase->expectWarning();
public function anError(): self
$this->testCase->expectError();
public function describedByAMessageMatching(string $pattern): self
$this->testCase->expectDeprecationMessageMatches($pattern);
public function describedByAMessageContaining(string $part): self
$this->testCase->expectDeprecationMessageMatches('/' . \preg_quote($part) . '/');