Example #1
0
 function testMockedMethodHasOwningMockAndName()
 {
     $builder = new MockBuilder('Mockista\\A');
     $method = $builder->mockme();
     $mock = $builder->getMock();
     $this->assertEquals($mock->mockista, $method->owningMock);
     $this->assertEquals('mockme', $method->name);
 }
Example #2
0
 public function testArgsMatcher()
 {
     $builder = new MockBuilder();
     $builder->abc(Matchers::isString())->andReturn(1);
     $builder->abc(Matchers::isString(), 2, Matchers::isInt())->andReturn(2);
     $mock = $builder->getMock();
     $this->assertEquals(1, $mock->abc('lorem ipsum'));
     $this->assertEquals(2, $mock->abc('dolor', 2, 1));
 }