Skip to content

Commit 1a11800

Browse files
committed
Make test suite code compatible with php 5.3.2+
1 parent 2191c93 commit 1a11800

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/Nulpunkt/PhpStub/StubTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class StubTest extends \PHPUnit_Framework_TestCase
88
{
99
public function testThatAStubRespondToDefinedMethods()
1010
{
11-
$stub = new Stub(['getId' => 42]);
11+
$stub = new Stub(array('getId' => 42));
1212
$this->assertSame(42, $stub->getId());
1313
}
1414

@@ -20,19 +20,19 @@ public function testThatItHasAllProperties()
2020

2121
public function testCanAccessAsProperty()
2222
{
23-
$stub = new Stub(['property' => 42]);
23+
$stub = new Stub(array('property' => 42));
2424
$this->assertSame(42, $stub->property);
2525
}
2626

2727
public function testPropertiesCanBeSeenByIsset()
2828
{
29-
$stub = new Stub(['property' => 42]);
29+
$stub = new Stub(array('property' => 42));
3030
$this->assertTrue(isset($stub->property), 'Properies can be seen by isset');
3131
}
3232

3333
public function testPropertiesCanBeUnset()
3434
{
35-
$stub = new Stub(['property' => 42]);
35+
$stub = new Stub(array('property' => 42));
3636
unset($stub->property);
3737
$this->assertFalse(isset($stub->property), 'Properies can be unset');
3838
}
@@ -43,13 +43,13 @@ public function testThatItWillCallAAnonomusCallable()
4343
return $argument;
4444
};
4545

46-
$stub = new Stub(['identity' => $identity]);
46+
$stub = new Stub(array('identity' => $identity));
4747
$this->assertSame(42, $stub->identity(42));
4848
}
4949

5050
public function testThatItWillCallANamedCallable()
5151
{
52-
$stub = new Stub(['callMe' => [$this, 'callMeMaybe']]);
52+
$stub = new Stub(array('callMe' => array($this, 'callMeMaybe')));
5353
$this->assertSame("Hello, Rebecca", $stub->callMe("Rebecca"));
5454
}
5555

@@ -67,7 +67,7 @@ public function testThatItReturnsItSelfIfNothingElse()
6767

6868
public function testThatItReturnsNullIfConfigured()
6969
{
70-
$stub = new Stub([], ['chainable' => false]);
70+
$stub = new Stub(array(), array('chainable' => false));
7171
$this->assertSame(null, $stub->getId());
7272
}
7373

@@ -76,7 +76,7 @@ public function testThatItReturnsNullIfConfigured()
7676
*/
7777
public function testThatItThrowsIfConfigured()
7878
{
79-
$stub = new Stub([], ['throw' => true]);
79+
$stub = new Stub(array(), array('throw' => true));
8080
$stub->getId();
8181
}
8282

@@ -87,12 +87,12 @@ public function testThatItThrowsIfConfigured()
8787
public function testThatItThrowsSpecifiedExceptionIfConfigured()
8888
{
8989
$stub = new Stub(
90-
[],
91-
[
90+
array(),
91+
array(
9292
'throw' => true,
9393
'exceptionclass' => 'InvalidArgumentException',
9494
'exceptionmessage' => 'Bad method call'
95-
]
95+
)
9696
);
9797
$stub->getId();
9898
}

0 commit comments

Comments
 (0)