Skip to content

Commit 1dad555

Browse files
committed
[refactor] moved testDefineFunctionMock() into php-mock
1 parent d2edb32 commit 1dad555

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

tests/PHPMockTest.php

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class PHPMockTest extends AbstractMockTest
1717

1818
use PHPMock;
1919

20+
protected function defineFunction($namespace, $functionName)
21+
{
22+
self::defineFunctionMock($namespace, $functionName);
23+
}
24+
2025
protected function mockFunction($namespace, $functionName, callable $function)
2126
{
2227
$mock = $this->getFunctionMock($namespace, $functionName);
@@ -27,34 +32,6 @@ protected function disableMocks()
2732
{
2833
}
2934

30-
/**
31-
* Tests defineFunctionMock().
32-
*
33-
* @test
34-
*/
35-
public function testDefineFunctionMock()
36-
{
37-
self::defineFunctionMock(__NAMESPACE__, "escapeshellcmd");
38-
self::escapeshellcmd("foo");
39-
40-
$mock = $this->getFunctionMock(__NAMESPACE__, "escapeshellcmd");
41-
$mock->expects($this->once())->willReturn("bar");
42-
43-
$this->assertEquals("bar", self::escapeshellcmd("foo"));
44-
}
45-
46-
/**
47-
* Returns the built-in call to escapeshellcmd().
48-
*
49-
* @param string $command Shell command.
50-
*
51-
* @return string The built-in call.
52-
*/
53-
private static function escapeshellcmd($command)
54-
{
55-
return escapeshellcmd($command);
56-
}
57-
5835
/**
5936
* Tests building a mock with arguments.
6037
*

0 commit comments

Comments
 (0)