Beispiel #1
0
 function testAddMethods()
 {
     $builder = new MockBuilder();
     $builder->addMethods(array('x' => 1, 'y' => function ($a) {
         return $a * 2;
     }));
     $mock = $builder->getMock();
     $this->assertTrue($mock instanceof \Mockista\Mock);
     $this->assertEquals(1, $mock->x());
     $this->assertEquals(4, $mock->y(2));
 }