Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed PHPUnit 5.7 warnings
  • Loading branch information
bancer committed Jul 16, 2017
1 parent 7ba52d0 commit 15f0fe3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
16 changes: 3 additions & 13 deletions lib/Cake/Test/Case/Console/ShellTest.php
Expand Up @@ -749,13 +749,10 @@ public function testRunCommandWithMethod() {
public function testRunCommandBaseclassMethod() {
$Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false);
$Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false);

$Parser->expects($this->once())->method('help');
$Mock->expects($this->once())->method('getOptionParser')
->will($this->returnValue($Parser));
$Mock->expects($this->never())->method('hr');
$Mock->expects($this->once())->method('out');

$Mock->runCommand('hr', array());
}

Expand All @@ -767,13 +764,10 @@ public function testRunCommandBaseclassMethod() {
public function testRunCommandMissingMethod() {
$Mock = $this->getMock('Shell', array('startup', 'getOptionParser', 'out'), array(), '', false);
$Parser = $this->getMock('ConsoleOptionParser', array(), array(), '', false);

$Parser->expects($this->once())->method('help');
$Mock->expects($this->never())->method('idontexist');
$Mock->expects($this->once())->method('getOptionParser')
->will($this->returnValue($Parser));
$Mock->expects($this->once())->method('out');

$result = $Mock->runCommand('idontexist', array());
$this->assertFalse($result);
}
Expand Down Expand Up @@ -1003,31 +997,27 @@ public function testGetInvalidHelper() {

/**
* Test that shell loggers do not get overridden in constructor if already configured
*
*
* @return void
*/
public function testShellLoggersDoNotGetOverridden() {
$shell = $this->getMock(
"Shell", array(
"_loggerIsConfigured",
"configureStdOutLogger",
"configureStdErrLogger",
"_configureStdOutLogger",
"_configureStdErrLogger",
),
array(),
"",
false
);

$shell->expects($this->exactly(2))
->method("_loggerIsConfigured")
->will($this->returnValue(true));

$shell->expects($this->never())
->method("_configureStdOutLogger");

$shell->expects($this->never())
->method("_configureStdErrLogger");

$shell->__construct();
}
}
6 changes: 0 additions & 6 deletions lib/Cake/Test/Case/Routing/DispatcherTest.php
Expand Up @@ -889,18 +889,12 @@ public function testDispatchActionSendsFile() {
'_clearBuffer',
'_flushBuffer'
));

$response->expects($this->never())
->method('body');

$response->expects($this->exactly(1))
->method('_isActive')
->will($this->returnValue(true));

ob_start();
$Dispatcher->dispatch($request, $response);
$result = ob_get_clean();

$this->assertEquals("/* this is the test asset css file */\n", $result);
}

Expand Down
7 changes: 0 additions & 7 deletions lib/Cake/Test/Case/Routing/Filter/AssetDispatcherTest.php
Expand Up @@ -154,13 +154,10 @@ public function testNotModified() {

$response = $this->getMock('CakeResponse', array('_sendHeader', 'checkNotModified'));
$request = new CakeRequest('theme/test_theme/img/cake.power.gif');

$response->expects($this->once())->method('checkNotModified')
->with($request)
->will($this->returnValue(true));
$response->expects($this->never())->method('send');
$event = new CakeEvent('DispatcherTest', $this, compact('request', 'response'));

$this->assertSame($response, $filter->beforeDispatch($event));
$this->assertEquals($time->format('D, j M Y H:i:s') . ' GMT', $response->modified());
}
Expand Down Expand Up @@ -193,13 +190,9 @@ public function test404OnDoubleDot() {
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
), App::RESET);

$response = $this->getMock('CakeResponse', array('_sendHeader'));
$request = new CakeRequest('theme/test_theme/../../../../../../VERSION.txt');
$event = new CakeEvent('Dispatcher.beforeRequest', $this, compact('request', 'response'));

$response->expects($this->never())->method('send');

$filter = new AssetDispatcher();
$this->assertNull($filter->beforeDispatch($event));
$this->assertFalse($event->isStopped());
Expand Down

0 comments on commit 15f0fe3

Please sign in to comment.