add myCalendar into
[awl.git] / vendor / phpunit / phpunit-mock-objects / Tests / MockObject / Invocation / ObjectTest.php
blobb28b1246f24058b2d7b516a55f82dd4c364629be
1 <?php
3 class Framework_MockObject_Invocation_ObjectTest extends PHPUnit_Framework_TestCase
5 public function testConstructorRequiresClassAndMethodAndParametersAndObject()
7 new PHPUnit_Framework_MockObject_Invocation_Object(
8 'FooClass',
9 'FooMethod',
10 array('an_argument'),
11 new StdClass);
14 public function testAllowToGetClassNameSetInConstructor()
16 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
17 'FooClass',
18 'FooMethod',
19 array('an_argument'),
20 new StdClass);
22 $this->assertSame('FooClass', $invocation->className);
25 public function testAllowToGetMethodNameSetInConstructor()
27 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
28 'FooClass',
29 'FooMethod',
30 array('an_argument'),
31 new StdClass);
33 $this->assertSame('FooMethod', $invocation->methodName);
36 public function testAllowToGetObjectSetInConstructor()
38 $expectedObject = new StdClass;
40 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
41 'FooClass',
42 'FooMethod',
43 array('an_argument'),
44 $expectedObject);
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(
56 'FooClass',
57 'FooMethod',
58 $expectedParameters,
59 new StdClass
62 $this->assertSame($expectedParameters, $invocation->parameters);
65 public function testConstructorAllowToSetFlagCloneObjectsInParameters()
67 $parameters = array(new StdClass);
68 $cloneObjects = TRUE;
70 $invocation = new PHPUnit_Framework_MockObject_Invocation_Object(
71 'FooClass',
72 'FooMethod',
73 $parameters,
74 new StdClass,
75 $cloneObjects
78 $this->assertEquals($parameters, $invocation->parameters);
79 $this->assertNotSame($parameters, $invocation->parameters);