Chris@0: assertSame('FooClass', $invocation->className); Chris@0: } Chris@0: Chris@0: public function testAllowToGetMethodNameSetInConstructor() Chris@0: { Chris@0: $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( Chris@0: 'FooClass', Chris@0: 'FooMethod', Chris@0: array('an_argument'), Chris@0: new StdClass Chris@0: ); Chris@0: Chris@0: $this->assertSame('FooMethod', $invocation->methodName); Chris@0: } Chris@0: Chris@0: public function testAllowToGetObjectSetInConstructor() Chris@0: { Chris@0: $expectedObject = new StdClass; Chris@0: Chris@0: $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( Chris@0: 'FooClass', Chris@0: 'FooMethod', Chris@0: array('an_argument'), Chris@0: $expectedObject Chris@0: ); Chris@0: Chris@0: $this->assertSame($expectedObject, $invocation->object); Chris@0: } Chris@0: Chris@0: public function testAllowToGetMethodParametersSetInConstructor() Chris@0: { Chris@0: $expectedParameters = array( Chris@0: 'foo', 5, array('a', 'b'), new StdClass, null, false Chris@0: ); Chris@0: Chris@0: $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( Chris@0: 'FooClass', Chris@0: 'FooMethod', Chris@0: $expectedParameters, Chris@0: new StdClass Chris@0: ); Chris@0: Chris@0: $this->assertSame($expectedParameters, $invocation->parameters); Chris@0: } Chris@0: Chris@0: public function testConstructorAllowToSetFlagCloneObjectsInParameters() Chris@0: { Chris@0: $parameters = array(new StdClass); Chris@0: $cloneObjects = true; Chris@0: Chris@0: $invocation = new PHPUnit_Framework_MockObject_Invocation_Object( Chris@0: 'FooClass', Chris@0: 'FooMethod', Chris@0: $parameters, Chris@0: new StdClass, Chris@0: $cloneObjects Chris@0: ); Chris@0: Chris@0: $this->assertEquals($parameters, $invocation->parameters); Chris@0: $this->assertNotSame($parameters, $invocation->parameters); Chris@0: } Chris@0: }