function returnFailure(Assert $assert) { $this->test->test('bar', function (Assert $assert) { $assert->fail(); }); $this->executeCommand($assert, [], 1); }
function incompleteTest(Assert $assert) { $this->suite->test('one', function (Assert $assert) { $assert->incomplete('Not done'); }); $this->runAndAssertOutput($assert, ['Foo', 'Foo::one -> Incomplete', '', '---- Incomplete ----', 'Foo::one [FILE:-11]', ' Not done', '', '=| 1 Incomplete']); }
function detailedFailureDescription(Assert $assert) { $this->suite->test('one', function (Assert $assert) { $assert->fail('Oh no!'); }); $this->suite->test('two', function (Assert $assert) { $assert->fail('Not this one'); }); $this->runAndAssertOutput($assert, ['FAILED: Foo::one', ' Source:', ' FILE:-25', ' Code:', ' $assert->fail(\'Oh no!\');', ' Message:', ' Failed', ' Oh no!', '', 'FAILED: Foo::two', ' Source:', ' FILE:-22', ' Code:', ' $assert->fail(\'Not this one\');', ' Message:', ' Failed', ' Not this one', '', '2 ran, 2 FAILED =(']); }
function mixedResults(Assert $assert) { $this->suite->test('one', function () { }); $this->suite->test('two', function (Assert $assert) { $assert->pass(); }); $this->suite->test('three', function (Assert $assert) { $assert->fail('Miserably'); }); $this->suite->test('four', function (Assert $assert) { $assert->pass(); }); $this->suite->test('five', function () { }); $this->runAndAssertOutput($assert, ['I.F.I', '', '---- Incomplete ----', 'Foo::one [FILE:-28]', ' No assertions made', 'Foo::five [FILE:-17]', ' No assertions made', '', '---- Failed ----', 'Foo::three [FILE:-23]', ' Failed', ' Miserably', '', '=( 2 Passed, 2 Incomplete, 1 Failed']); }
function failAssertion(Assert $assert) { $assert->isTrue(false); }
public function that(Assertion $assertion, $message = "") { $this->parent->that(new OppositeAssertion($assertion), $message); }
function assertOfStaticSuiteIsPassedToInjectedObject(Assert $assert) { $this->files->givenTheFile_Containing('inject/InjectAssertStatic.php', '<?php /** @property InjectedThing $that <- */ class InjectAssertStatic extends ' . StaticTestSuite::class . ' { function foo() { $this->that->assert->pass(); } function bar() { } } /** @property ' . Assert::class . ' $assert <- */ class InjectedThingStatic {} '); $this->runFileTestSuite('inject/InjectAssertStatic.php'); $assert->isInstanceOf($this->listener->results[0], PassedTestResult::class); $assert->isInstanceOf($this->listener->results[1], IncompleteTestResult::class); }
public function foo(Assert $asserter) { $asserter->pass(); }