@@ -8,7 +8,7 @@ class StubTest extends \PHPUnit_Framework_TestCase
8
8
{
9
9
public function testThatAStubRespondToDefinedMethods ()
10
10
{
11
- $ stub = new Stub ([ 'getId ' => 42 ] );
11
+ $ stub = new Stub (array ( 'getId ' => 42 ) );
12
12
$ this ->assertSame (42 , $ stub ->getId ());
13
13
}
14
14
@@ -20,19 +20,19 @@ public function testThatItHasAllProperties()
20
20
21
21
public function testCanAccessAsProperty ()
22
22
{
23
- $ stub = new Stub ([ 'property ' => 42 ] );
23
+ $ stub = new Stub (array ( 'property ' => 42 ) );
24
24
$ this ->assertSame (42 , $ stub ->property );
25
25
}
26
26
27
27
public function testPropertiesCanBeSeenByIsset ()
28
28
{
29
- $ stub = new Stub ([ 'property ' => 42 ] );
29
+ $ stub = new Stub (array ( 'property ' => 42 ) );
30
30
$ this ->assertTrue (isset ($ stub ->property ), 'Properies can be seen by isset ' );
31
31
}
32
32
33
33
public function testPropertiesCanBeUnset ()
34
34
{
35
- $ stub = new Stub ([ 'property ' => 42 ] );
35
+ $ stub = new Stub (array ( 'property ' => 42 ) );
36
36
unset($ stub ->property );
37
37
$ this ->assertFalse (isset ($ stub ->property ), 'Properies can be unset ' );
38
38
}
@@ -43,13 +43,13 @@ public function testThatItWillCallAAnonomusCallable()
43
43
return $ argument ;
44
44
};
45
45
46
- $ stub = new Stub ([ 'identity ' => $ identity] );
46
+ $ stub = new Stub (array ( 'identity ' => $ identity) );
47
47
$ this ->assertSame (42 , $ stub ->identity (42 ));
48
48
}
49
49
50
50
public function testThatItWillCallANamedCallable ()
51
51
{
52
- $ stub = new Stub ([ 'callMe ' => [ $ this , 'callMeMaybe ' ]] );
52
+ $ stub = new Stub (array ( 'callMe ' => array ( $ this , 'callMeMaybe ' )) );
53
53
$ this ->assertSame ("Hello, Rebecca " , $ stub ->callMe ("Rebecca " ));
54
54
}
55
55
@@ -67,7 +67,7 @@ public function testThatItReturnsItSelfIfNothingElse()
67
67
68
68
public function testThatItReturnsNullIfConfigured ()
69
69
{
70
- $ stub = new Stub ([], [ 'chainable ' => false ] );
70
+ $ stub = new Stub (array (), array ( 'chainable ' => false ) );
71
71
$ this ->assertSame (null , $ stub ->getId ());
72
72
}
73
73
@@ -76,7 +76,7 @@ public function testThatItReturnsNullIfConfigured()
76
76
*/
77
77
public function testThatItThrowsIfConfigured ()
78
78
{
79
- $ stub = new Stub ([], [ 'throw ' => true ] );
79
+ $ stub = new Stub (array (), array ( 'throw ' => true ) );
80
80
$ stub ->getId ();
81
81
}
82
82
@@ -87,12 +87,12 @@ public function testThatItThrowsIfConfigured()
87
87
public function testThatItThrowsSpecifiedExceptionIfConfigured ()
88
88
{
89
89
$ stub = new Stub (
90
- [] ,
91
- [
90
+ array () ,
91
+ array (
92
92
'throw ' => true ,
93
93
'exceptionclass ' => 'InvalidArgumentException ' ,
94
94
'exceptionmessage ' => 'Bad method call '
95
- ]
95
+ )
96
96
);
97
97
$ stub ->getId ();
98
98
}
0 commit comments