Skip to content

Commit c849ffc

Browse files
authored
Merge pull request #399 from gotoeveryone/fix/celltest-request-response
Using \Cake\Http\ServerRequest|Response instead of \Cake\Network\*
2 parents d339c79 + 17547ae commit c849ffc

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/Shell/Task/BakeTemplateTask.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
use Cake\Core\ConventionsTrait;
2020
use Cake\Event\Event;
2121
use Cake\Event\EventManager;
22-
use Cake\Network\Request;
23-
use Cake\Network\Response;
22+
use Cake\Http\Response;
23+
use Cake\Http\ServerRequest as Request;
2424
use Cake\View\Exception\MissingTemplateException;
2525
use Cake\View\ViewVarsTrait;
2626

src/Shell/Task/TestTask.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
use Cake\Core\Exception\Exception;
2121
use Cake\Core\Plugin;
2222
use Cake\Filesystem\Folder;
23-
use Cake\Network\Request;
24-
use Cake\Network\Response;
23+
use Cake\Http\Response;
24+
use Cake\Http\ServerRequest as Request;
2525
use Cake\ORM\Association;
2626
use Cake\ORM\Table;
2727
use Cake\ORM\TableRegistry;
@@ -551,8 +551,8 @@ public function generateConstructor($type, $fullClassName)
551551
$construct .= " ->getMock();";
552552
}
553553
if ($type === 'cell') {
554-
$pre = "\$this->request = \$this->getMockBuilder('Cake\Network\Request')->getMock();\n";
555-
$pre .= " \$this->response = \$this->getMockBuilder('Cake\Network\Response')->getMock();";
554+
$pre = "\$this->request = \$this->getMockBuilder('Cake\Http\ServerRequest')->getMock();\n";
555+
$pre .= " \$this->response = \$this->getMockBuilder('Cake\Http\Response')->getMock();";
556556
$construct = "new {$className}(\$this->request, \$this->response);";
557557
}
558558
if ($type === 'shell_helper') {
@@ -588,7 +588,7 @@ public function generateProperties($type, $subject, $fullClassName)
588588
case 'cell':
589589
$properties[] = [
590590
'description' => 'Request mock',
591-
'type' => '\Cake\Network\Request|\PHPUnit_Framework_MockObject_MockObject',
591+
'type' => '\Cake\Http\ServerRequest|\PHPUnit_Framework_MockObject_MockObject',
592592
'name' => 'request'
593593
];
594594
$properties[] = [

tests/TestCase/Shell/Task/TestTaskTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
use Bake\Test\TestCase\TestCase;
2222
use Cake\Core\Configure;
2323
use Cake\Core\Plugin;
24-
use Cake\Network\Request;
25-
use Cake\Network\Response;
24+
use Cake\Http\Response;
25+
use Cake\Http\ServerRequest as Request;
2626
use Cake\ORM\TableRegistry;
2727

2828
/**

tests/TestCase/View/BakeViewTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
use Cake\Core\Configure;
1919
use Cake\Core\Plugin;
2020
use Cake\Event\Event;
21-
use Cake\Network\Request;
22-
use Cake\Network\Response;
21+
use Cake\Http\Response;
22+
use Cake\Http\ServerRequest as Request;
2323
use Cake\TestSuite\StringCompareTrait;
2424
use Cake\TestSuite\TestCase;
2525

tests/TestCase/View/Helper/BakeHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
use Bake\View\BakeView;
1818
use Bake\View\Helper\BakeHelper;
19-
use Cake\Network\Request;
19+
use Cake\Http\ServerRequest as Request;
2020
use Cake\ORM\TableRegistry;
2121
use Cake\TestSuite\Stub\Response;
2222
use Cake\TestSuite\TestCase;

tests/comparisons/Test/testBakeCellTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ArticlesCellTest extends TestCase
1313
/**
1414
* Request mock
1515
*
16-
* @var \Cake\Network\Request|\PHPUnit_Framework_MockObject_MockObject
16+
* @var \Cake\Http\ServerRequest|\PHPUnit_Framework_MockObject_MockObject
1717
*/
1818
public $request;
1919

@@ -39,8 +39,8 @@ class ArticlesCellTest extends TestCase
3939
public function setUp()
4040
{
4141
parent::setUp();
42-
$this->request = $this->getMockBuilder('Cake\Network\Request')->getMock();
43-
$this->response = $this->getMockBuilder('Cake\Network\Response')->getMock();
42+
$this->request = $this->getMockBuilder('Cake\Http\ServerRequest')->getMock();
43+
$this->response = $this->getMockBuilder('Cake\Http\Response')->getMock();
4444
$this->Articles = new ArticlesCell($this->request, $this->response);
4545
}
4646

0 commit comments

Comments
 (0)