Remove useless backups.

PHPUnit does this for us.
Fix formatting and whitespace.
This commit is contained in:
mark_story 2012-04-17 21:50:47 -04:00
parent c871d85f2b
commit c15259f49c

View file

@ -30,10 +30,6 @@ class CakeRequestTest extends CakeTestCase {
*/
public function setUp() {
parent::setUp();
$this->_server = $_SERVER;
$this->_get = $_GET;
$this->_post = $_POST;
$this->_files = $_FILES;
$this->_app = Configure::read('App');
$this->_case = null;
if (isset($_GET['case'])) {
@ -51,10 +47,6 @@ class CakeRequestTest extends CakeTestCase {
*/
public function tearDown() {
parent::tearDown();
$_SERVER = $this->_server;
$_GET = $this->_get;
$_POST = $this->_post;
$_FILES = $this->_files;
if (!empty($this->_case)) {
$_GET['case'] = $this->_case;
}
@ -217,8 +209,10 @@ class CakeRequestTest extends CakeTestCase {
*
* @return void
*/
public function testFILESParsing() {
$_FILES = array('data' => array('name' => array(
public function testFilesParsing() {
$_FILES = array(
'data' => array(
'name' => array(
'File' => array(
array('data' => 'cake_sqlserver_patch.patch'),
array('data' => 'controller.diff'),
@ -263,18 +257,21 @@ class CakeRequestTest extends CakeTestCase {
),
'Post' => array('attachment' => 80469)
),
));
)
);
$request = new CakeRequest('some/path');
$expected = array(
'File' => array(
array('data' => array(
array(
'data' => array(
'name' => 'cake_sqlserver_patch.patch',
'type' => '',
'tmp_name' => '/private/var/tmp/phpy05Ywj',
'error' => 0,
'size' => 6271,
)),
)
),
array(
'data' => array(
'name' => 'controller.diff',
@ -282,29 +279,36 @@ class CakeRequestTest extends CakeTestCase {
'tmp_name' => '/private/var/tmp/php7MBztY',
'error' => 0,
'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',
'type' => 'application/x-javascript',
'tmp_name' => '/private/var/tmp/phpEwlrIo',
'error' => 0,
'size' => 80469,
))
)
)
);
$this->assertEquals($expected, $request->data);