コード例 #1
0
ファイル: ExpectationSpec.php プロジェクト: Ilyes512/kahlan
         expect($expectation->not())->toBe(false);
         expect($expectation->not)->toBe($expectation);
         expect($expectation->not())->toBe(true);
     });
     it("throws an exception with unsupported attributes", function () {
         $closure = function () {
             $expectation = new Expectation();
             $expectation->abc;
         };
         expect($closure)->toThrow(new Exception('Unsupported attribute `abc`.'));
     });
 });
 describe("->clear()", function () {
     it("clears an expectation", function () {
         $actual = new stdClass();
         $expectation = Expectation::expect($actual, 10);
         $matcher = $expectation->not->toReceive('helloWorld');
         expect($expectation->actual())->toBe($actual);
         expect($expectation->deferred())->toHaveLength(1);
         expect($expectation->timeout())->toBe(10);
         expect($expectation->not())->toBe(true);
         expect($expectation->passed())->toBe(true);
         expect($expectation->logs())->toHaveLength(1);
         $expectation->clear();
         expect($expectation->actual())->toBe(null);
         expect($expectation->deferred())->toHaveLength(0);
         expect($expectation->timeout())->toBe(-1);
         expect($expectation->not())->toBe(false);
         expect($expectation->passed())->toBe(true);
         expect($expectation->logs())->toHaveLength(0);
     });