/** * Basic single stubbing */ public function testVerifySingleStub() { $mock = ShortifyPunit::mock('Foo'); ShortifyPunit::when($mock)->bar()->returns(1); $mock->bar(); $this->assertTrue(ShortifyPunit::verify($mock)->bar()->atLeast(1)); $this->assertTrue(ShortifyPunit::verify($mock)->bar()->calledTimes(1)); $this->assertTrue(ShortifyPunit::verify($mock)->bar()->lessThan(2)); $mock->bar(); $this->assertTrue(ShortifyPunit::verify($mock)->bar()->atLeast(2)); $this->assertTrue(ShortifyPunit::verify($mock)->bar()->calledTimes(2)); $this->assertTrue(ShortifyPunit::verify($mock)->bar()->lessThan(3)); ShortifyPunit::when($mock)->bar(1)->returns(2); $this->assertTrue(ShortifyPunit::verify($mock)->bar(1)->neverCalled()); $this->assertTrue(ShortifyPunit::verify($mock)->bar(1)->atLeast(0)); $this->assertTrue(ShortifyPunit::verify($mock)->bar(1)->calledTimes(0)); $this->assertTrue(ShortifyPunit::verify($mock)->bar(1)->lessThan(1)); $mock->bar(1); $this->assertTrue(ShortifyPunit::Verify($mock)->bar(1)->atLeast(1)); $this->assertTrue(ShortifyPunit::Verify($mock)->bar(1)->calledTimes(1)); $this->assertTrue(ShortifyPunit::Verify($mock)->bar(1)->lessThan(2)); }