3 class Framework_MockObject_Invocation_ObjectTest
extends PHPUnit_Framework_TestCase
5 public function testConstructorRequiresClassAndMethodAndParametersAndObject()
7 new PHPUnit_Framework_MockObject_Invocation_Object(
14 public function testAllowToGetClassNameSetInConstructor()
16 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
22 $this->assertSame('FooClass', $invocation->className
);
25 public function testAllowToGetMethodNameSetInConstructor()
27 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
33 $this->assertSame('FooMethod', $invocation->methodName
);
36 public function testAllowToGetObjectSetInConstructor()
38 $expectedObject = new StdClass
;
40 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
46 $this->assertSame($expectedObject, $invocation->object);
49 public function testAllowToGetMethodParametersSetInConstructor()
51 $expectedParameters = array(
52 'foo', 5, array('a', 'b'), new StdClass
, NULL, FALSE
55 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
62 $this->assertSame($expectedParameters, $invocation->parameters
);
65 public function testConstructorAllowToSetFlagCloneObjectsInParameters()
67 $parameters = array(new StdClass
);
70 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
78 $this->assertEquals($parameters, $invocation->parameters
);
79 $this->assertNotSame($parameters, $invocation->parameters
);