Skip to content

Commit 62cd87c

Browse files
author
Luca Degasperi
committed
covered the __call method on the proxy too.
1 parent 7741df0 commit 62cd87c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/AuthorizationServerProxyTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,26 @@ public function test_access_token_with_generic_error()
8484

8585
}
8686

87+
public function test_calls_to_underlying_object()
88+
{
89+
$mock = $this->getMock();
90+
$mock->shouldReceive('unexistingMethod')->times(6)->andReturn('baz');
91+
92+
$proxy = $this->getProxy($mock);
93+
$responses = array();
94+
$responses[] = $proxy->unexistingMethod();
95+
$responses[] = $proxy->unexistingMethod('foo');
96+
$responses[] = $proxy->unexistingMethod('foo', 'bar');
97+
$responses[] = $proxy->unexistingMethod('foo', 'bar', 'foo');
98+
$responses[] = $proxy->unexistingMethod('foo', 'bar', 'foo', 'bar');
99+
$responses[] = $proxy->unexistingMethod('foo', 'bar', 'foo', 'bar', 'foo');
100+
101+
for($i = 0; $i < count($responses); $i++)
102+
{
103+
$this->assertEquals('baz', $responses[$i]);
104+
}
105+
}
106+
87107
public function tearDown() {
88108
m::close();
89109
}

0 commit comments

Comments
 (0)