From 89100f947682ae0cdbc383a3dfbd152c5da884d5 Mon Sep 17 00:00:00 2001 From: Ceeram Date: Mon, 18 Mar 2013 11:12:28 +0100 Subject: [PATCH] fix coding standards --- .../Case/TestSuite/CakeTestFixtureTest.php | 14 ++-- .../TestSuite/CakeTestSuiteDispatcherTest.php | 70 ++++++++++++------- .../TestSuite/CakeTestSuiteDispatcher.php | 4 +- 3 files changed, 54 insertions(+), 34 deletions(-) diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php index 394195520..7684bdf9c 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestFixtureTest.php @@ -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 ), ); diff --git a/lib/Cake/Test/Case/TestSuite/CakeTestSuiteDispatcherTest.php b/lib/Cake/Test/Case/TestSuite/CakeTestSuiteDispatcherTest.php index 9969370f1..a736223c8 100644 --- a/lib/Cake/Test/Case/TestSuite/CakeTestSuiteDispatcherTest.php +++ b/lib/Cake/Test/Case/TestSuite/CakeTestSuiteDispatcherTest.php @@ -1,38 +1,58 @@ 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"); + } -} +} \ No newline at end of file diff --git a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php index 86dfd3895..88db1a509 100644 --- a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php +++ b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php @@ -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; } /**