mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Remove useless backups.
PHPUnit does this for us. Fix formatting and whitespace.
This commit is contained in:
parent
c871d85f2b
commit
c15259f49c
1 changed files with 98 additions and 94 deletions
|
@ -30,10 +30,6 @@ class CakeRequestTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function setUp() {
|
public function setUp() {
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->_server = $_SERVER;
|
|
||||||
$this->_get = $_GET;
|
|
||||||
$this->_post = $_POST;
|
|
||||||
$this->_files = $_FILES;
|
|
||||||
$this->_app = Configure::read('App');
|
$this->_app = Configure::read('App');
|
||||||
$this->_case = null;
|
$this->_case = null;
|
||||||
if (isset($_GET['case'])) {
|
if (isset($_GET['case'])) {
|
||||||
|
@ -51,10 +47,6 @@ class CakeRequestTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
public function tearDown() {
|
public function tearDown() {
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
$_SERVER = $this->_server;
|
|
||||||
$_GET = $this->_get;
|
|
||||||
$_POST = $this->_post;
|
|
||||||
$_FILES = $this->_files;
|
|
||||||
if (!empty($this->_case)) {
|
if (!empty($this->_case)) {
|
||||||
$_GET['case'] = $this->_case;
|
$_GET['case'] = $this->_case;
|
||||||
}
|
}
|
||||||
|
@ -217,8 +209,10 @@ class CakeRequestTest extends CakeTestCase {
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testFILESParsing() {
|
public function testFilesParsing() {
|
||||||
$_FILES = array('data' => array('name' => array(
|
$_FILES = array(
|
||||||
|
'data' => array(
|
||||||
|
'name' => array(
|
||||||
'File' => array(
|
'File' => array(
|
||||||
array('data' => 'cake_sqlserver_patch.patch'),
|
array('data' => 'cake_sqlserver_patch.patch'),
|
||||||
array('data' => 'controller.diff'),
|
array('data' => 'controller.diff'),
|
||||||
|
@ -263,18 +257,21 @@ class CakeRequestTest extends CakeTestCase {
|
||||||
),
|
),
|
||||||
'Post' => array('attachment' => 80469)
|
'Post' => array('attachment' => 80469)
|
||||||
),
|
),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
$request = new CakeRequest('some/path');
|
$request = new CakeRequest('some/path');
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'File' => array(
|
'File' => array(
|
||||||
array('data' => array(
|
array(
|
||||||
|
'data' => array(
|
||||||
'name' => 'cake_sqlserver_patch.patch',
|
'name' => 'cake_sqlserver_patch.patch',
|
||||||
'type' => '',
|
'type' => '',
|
||||||
'tmp_name' => '/private/var/tmp/phpy05Ywj',
|
'tmp_name' => '/private/var/tmp/phpy05Ywj',
|
||||||
'error' => 0,
|
'error' => 0,
|
||||||
'size' => 6271,
|
'size' => 6271,
|
||||||
)),
|
)
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'data' => array(
|
'data' => array(
|
||||||
'name' => 'controller.diff',
|
'name' => 'controller.diff',
|
||||||
|
@ -282,29 +279,36 @@ class CakeRequestTest extends CakeTestCase {
|
||||||
'tmp_name' => '/private/var/tmp/php7MBztY',
|
'tmp_name' => '/private/var/tmp/php7MBztY',
|
||||||
'error' => 0,
|
'error' => 0,
|
||||||
'size' => 350,
|
'size' => 350,
|
||||||
)),
|
)
|
||||||
array('data' => array(
|
|
||||||
'name' => '',
|
|
||||||
'type' => '',
|
|
||||||
'tmp_name' => '',
|
|
||||||
'error' => 4,
|
|
||||||
'size' => 0,
|
|
||||||
)),
|
|
||||||
array('data' => array(
|
|
||||||
'name' => '',
|
|
||||||
'type' => '',
|
|
||||||
'tmp_name' => '',
|
|
||||||
'error' => 4,
|
|
||||||
'size' => 0,
|
|
||||||
)),
|
|
||||||
),
|
),
|
||||||
'Post' => array('attachment' => array(
|
array(
|
||||||
|
'data' => array(
|
||||||
|
'name' => '',
|
||||||
|
'type' => '',
|
||||||
|
'tmp_name' => '',
|
||||||
|
'error' => 4,
|
||||||
|
'size' => 0,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'data' => array(
|
||||||
|
'name' => '',
|
||||||
|
'type' => '',
|
||||||
|
'tmp_name' => '',
|
||||||
|
'error' => 4,
|
||||||
|
'size' => 0,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'Post' => array(
|
||||||
|
'attachment' => array(
|
||||||
'name' => 'jquery-1.2.1.js',
|
'name' => 'jquery-1.2.1.js',
|
||||||
'type' => 'application/x-javascript',
|
'type' => 'application/x-javascript',
|
||||||
'tmp_name' => '/private/var/tmp/phpEwlrIo',
|
'tmp_name' => '/private/var/tmp/phpEwlrIo',
|
||||||
'error' => 0,
|
'error' => 0,
|
||||||
'size' => 80469,
|
'size' => 80469,
|
||||||
))
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
$this->assertEquals($expected, $request->data);
|
$this->assertEquals($expected, $request->data);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue