Example #1
0
 function testGenerateClassArgsMethods()
 {
     $mock = \Mockista\mock('Mockista\\MockFactoryTest_Generated', array('x' => 1, 'y' => function () {
         return 2;
     }));
     $this->assertInstanceOf('\\Mockista\\MockFactoryTest_Generated', $mock);
     $this->assertEquals(1, $mock->x(1, 2, 3));
     $this->assertEquals(2, $mock->y());
 }
Example #2
0
 /**
  * @expectedException Mockista\MockException
  * @expectedExceptionCode 4
  */
 public function testNotMatchedCircularParameter()
 {
     $arg = new Circular();
     $mock = \Mockista\mock();
     $mock->expects('method')->with()->once()->andReturn(1);
     $this->assertEquals(1, $mock->method($arg, 4, 'asdf'));
 }