Skip to content

Commit fc6884f

Browse files
committed
FuncProxy methods incorrectly override parent class methods. Fix #41
1 parent 66264df commit fc6884f

File tree

5 files changed

+46
-11
lines changed

5 files changed

+46
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
#### 0.5.1
4+
5+
* Fixed strict errors for func verifier *2014-10-16*
6+
7+
38
#### 0.5.0
49

510
* test::ns() method removed *2014-10-10*

RoboFile.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public function release()
3333
->uri('Codeception/AspectMock')
3434
->askDescription()
3535
->run();
36+
37+
$this->bump();
3638
}
3739

3840
public function docs()

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.0
1+
0.5.1

src/AspectMock/Proxy/FuncProxy.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,47 @@
2323
* ```
2424
*
2525
*/
26-
class FuncProxy extends Verifier
26+
class FuncProxy
2727
{
2828
protected $func;
2929
protected $ns;
3030
protected $fullFuncName;
3131

32+
/**
33+
* @var FuncVerifier
34+
*/
35+
protected $funcVerifier;
36+
3237
public function __construct($namespace, $func)
3338
{
3439
$this->func = $func;
3540
$this->ns = $namespace;
3641
$this->fullFuncName = $namespace . '/' . $func;
37-
}
38-
39-
protected function callSyntax($method)
40-
{
41-
return "";
42+
$this->funcVerifier = new FuncVerifier($namespace);
4243
}
4344

4445
/**
4546
* @param null $params
4647
*/
4748
public function verifyInvoked($params = null)
4849
{
49-
parent::verifyInvoked($this->func, $params);
50+
$this->funcVerifier->verifyInvoked($this->func, $params);
5051
}
5152

5253
/**
5354
* @param null $params
5455
*/
5556
public function verifyInvokedOnce($params = null)
5657
{
57-
$this->verifyInvokedMultipleTimes(1, $params);
58+
$this->funcVerifier->verifyInvokedMultipleTimes($this->func, 1, $params);
5859
}
5960

6061
/**
6162
* @param null $params
6263
*/
6364
public function verifyNeverInvoked($params = null)
6465
{
65-
parent::verifyNeverInvoked($this->func, $params);
66+
$this->funcVerifier->verifyNeverInvoked($this->func, $params);
6667
}
6768

6869
/**
@@ -71,7 +72,7 @@ public function verifyNeverInvoked($params = null)
7172
*/
7273
public function verifyInvokedMultipleTimes($times, $params = null)
7374
{
74-
parent::verifyInvokedMultipleTimes($this->func, $times, $params);
75+
$this->funcVerifier->verifyInvokedMultipleTimes($this->func, $times, $params);
7576
}
7677

7778
/**
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
namespace AspectMock\Proxy;
3+
4+
use AspectMock\Core\Registry;
5+
6+
class FuncVerifier extends Verifier
7+
{
8+
protected $ns;
9+
10+
public function __construct($namespace)
11+
{
12+
$this->ns = $namespace;
13+
}
14+
15+
protected function callSyntax($method)
16+
{
17+
return "";
18+
}
19+
20+
public function getCallsForMethod($func)
21+
{
22+
$calls = Registry::getFuncCallsFor($this->ns . '\\' . $func);
23+
return $calls;
24+
}
25+
26+
27+
}

0 commit comments

Comments
 (0)