fix coding standards

This commit is contained in:
Ceeram 2013-03-18 11:12:28 +01:00
parent 83de70efcf
commit 89100f9476
3 changed files with 54 additions and 34 deletions

View file

@ -437,7 +437,7 @@ class CakeTestFixtureTest extends CakeTestCase {
$this->insertMulti['fields'] = $fields;
$this->insertMulti['values'] = $values;
$this->insertMulti['fields_values'] = array();
foreach($values as $record) {
foreach ($values as $record) {
$this->insertMulti['fields_values'][] = array_combine($fields, $record);
}
return true;
@ -467,18 +467,18 @@ class CakeTestFixtureTest extends CakeTestCase {
$this->assertEquals($expected, $this->insertMulti['values']);
$expected = array(
array(
'name' => 'Mark Doe',
'email' => 'mark.doe@email.com',
'name' => 'Mark Doe',
'email' => 'mark.doe@email.com',
'age' => null
),
array(
'name' => 'John Doe',
'email' => 'john.doe@email.com',
'name' => 'John Doe',
'email' => 'john.doe@email.com',
'age' => 20
),
array(
'name' => 'Jane Doe',
'email' => 'jane.doe@email.com',
'name' => 'Jane Doe',
'email' => 'jane.doe@email.com',
'age' => 30
),
);

View file

@ -1,38 +1,58 @@
<?php
/**
* CakeTestSuiteDispatcherTest file
*
* Test Case for CakeTestSuiteDispatcher class
*
* PHP version 5
*
* CakePHP : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP Project
* @package Cake.Test.Case.TestSuite
* @since CakePHP v 2.3.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
class CakeTestSuiteDispatcherTest extends CakeTestCase {
public function setUp() {
$this->vendors = App::path('vendors');
$this->includePath = ini_get('include_path');
}
public function setUp() {
$this->vendors = App::path('vendors');
$this->includePath = ini_get('include_path');
}
public function tearDown() {
App::build(array('Vendor' => $this->vendors), App::RESET);
ini_set('include_path', $this->includePath);
}
public function tearDown() {
App::build(array('Vendor' => $this->vendors), App::RESET);
ini_set('include_path', $this->includePath);
}
protected function clearPaths() {
App::build(array('Vendor' => array('junk')), App::RESET);
ini_set('include_path', 'junk');
}
protected function clearPaths() {
App::build(array('Vendor' => array('junk')), App::RESET);
ini_set('include_path', 'junk');
}
public function testLoadTestFramework() {
$dispatcher = new CakeTestSuiteDispatcher();
public function testLoadTestFramework() {
$dispatcher = new CakeTestSuiteDispatcher();
$this->assertTrue($dispatcher->loadTestFramework());
$this->assertTrue($dispatcher->loadTestFramework());
$this->clearPaths();
$this->clearPaths();
$exception = null;
$exception = null;
try {
$dispatcher->loadTestFramework();
} catch (Exception $ex) {
$exception = $ex;
}
try {
$dispatcher->loadTestFramework();
} catch (Exception $ex) {
$exception = $ex;
}
$this->assertEquals(get_class($exception), "PHPUnit_Framework_Error_Warning");
}
$this->assertEquals(get_class($exception), "PHPUnit_Framework_Error_Warning");
}
}
}

View file

@ -138,14 +138,14 @@ class CakeTestSuiteDispatcher {
*/
public function loadTestFramework() {
foreach (App::path('vendors') as $vendor) {
$vendor = rtrim($vendor, DS);
$vendor = rtrim($vendor, DS);
if (is_dir($vendor . DS . 'PHPUnit')) {
ini_set('include_path', $vendor . PATH_SEPARATOR . ini_get('include_path'));
break;
}
}
return (include('PHPUnit' . DS . 'Autoload.php')) !== false;
return (include ('PHPUnit' . DS . 'Autoload.php')) !== false;
}
/**