From d3105332dca2454463ed95a441e0ac253f8ce356 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 1 Sep 2012 12:14:15 +0100 Subject: [PATCH] Fix coding standards errors. --- lib/Cake/Console/Command/Task/TestTask.php | 7 +++--- lib/Cake/Test/Case/BasicsTest.php | 2 +- .../Test/Case/Network/Email/CakeEmailTest.php | 4 ++-- lib/Cake/Test/Case/Utility/ValidationTest.php | 22 +++++++++---------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index edee2d21b5f..0a7b53ff45e 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -331,13 +331,14 @@ public function mapType($type, $plugin) { /** * Get the base class and package name for a given type. * - * @param string $package The package the class having a test + * @param string $type The type the class having a test * generated for is in. - * @return array Array of class, type) + * @return array Array of (class, type) + * @throws CakeException On invalid typename */ public function getBaseType($type) { if (empty($this->baseTypes[$type])) { - throw new CakeException(__d('cake_dev', 'Invalid package name')); + throw new CakeException(__d('cake_dev', 'Invalid type name')); } return $this->baseTypes[$type]; } diff --git a/lib/Cake/Test/Case/BasicsTest.php b/lib/Cake/Test/Case/BasicsTest.php index 4079869193c..0c12fed6fab 100644 --- a/lib/Cake/Test/Case/BasicsTest.php +++ b/lib/Cake/Test/Case/BasicsTest.php @@ -225,7 +225,7 @@ public function testH() { 'n' => ' ' ); $this->assertEquals($expected, $result); - + // Test that boolean values are not converted to strings $result = h(false); $this->assertFalse($result); diff --git a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php index cefef163ca7..94b5f373ffc 100644 --- a/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php +++ b/lib/Cake/Test/Case/Network/Email/CakeEmailTest.php @@ -1119,11 +1119,11 @@ public function testSendRenderWithImage() { $this->CakeEmail->template('image'); $this->CakeEmail->emailFormat('html'); $server = env('SERVER_NAME') ? env('SERVER_NAME') : 'localhost'; - + if (env('SERVER_PORT') != null && env('SERVER_PORT') != 80) { $server .= ':' . env('SERVER_PORT'); } - + $expected = 'cool image'; $result = $this->CakeEmail->send(); $this->assertContains($expected, $result['message']); diff --git a/lib/Cake/Test/Case/Utility/ValidationTest.php b/lib/Cake/Test/Case/Utility/ValidationTest.php index d9886a66332..73bc5e635e8 100644 --- a/lib/Cake/Test/Case/Utility/ValidationTest.php +++ b/lib/Cake/Test/Case/Utility/ValidationTest.php @@ -1510,9 +1510,9 @@ public function testDecimalWithPlacesNull() { $this->assertTrue(Validation::decimal('1234', null)); $this->assertTrue(Validation::decimal('-1234', null)); $this->assertTrue(Validation::decimal('+1234', null)); - $this->assertTrue(Validation::decimal((float) 1234, null)); - $this->assertTrue(Validation::decimal((double) 1234, null)); - $this->assertTrue(Validation::decimal((int) 1234, null)); + $this->assertTrue(Validation::decimal((float)1234, null)); + $this->assertTrue(Validation::decimal((double)1234, null)); + $this->assertTrue(Validation::decimal((int)1234, null)); $this->assertFalse(Validation::decimal('', null)); $this->assertFalse(Validation::decimal('string', null)); @@ -1540,13 +1540,13 @@ public function testDecimalWithPlacesTrue() { $this->assertTrue(Validation::decimal('.00', true)); $this->assertTrue(Validation::decimal(.01, true)); $this->assertTrue(Validation::decimal('.01', true)); - $this->assertTrue(Validation::decimal((float) 1234, true)); - $this->assertTrue(Validation::decimal((double) 1234, true)); + $this->assertTrue(Validation::decimal((float)1234, true)); + $this->assertTrue(Validation::decimal((double)1234, true)); $this->assertFalse(Validation::decimal('', true)); $this->assertFalse(Validation::decimal('string', true)); $this->assertFalse(Validation::decimal('1234.', true)); - $this->assertFalse(Validation::decimal((int) 1234, true)); + $this->assertFalse(Validation::decimal((int)1234, true)); $this->assertFalse(Validation::decimal('1234', true)); $this->assertFalse(Validation::decimal('-1234', true)); $this->assertFalse(Validation::decimal('+1234', true)); @@ -1580,9 +1580,9 @@ public function testDecimalWithPlacesNumeric() { $this->assertFalse(Validation::decimal('1234.', 1)); $this->assertFalse(Validation::decimal(.0, 1)); $this->assertFalse(Validation::decimal(.00, 2)); - $this->assertFalse(Validation::decimal((float) 1234, 1)); - $this->assertFalse(Validation::decimal((double) 1234, 1)); - $this->assertFalse(Validation::decimal((int) 1234, 1)); + $this->assertFalse(Validation::decimal((float)1234, 1)); + $this->assertFalse(Validation::decimal((double)1234, 1)); + $this->assertFalse(Validation::decimal((int)1234, 1)); $this->assertFalse(Validation::decimal('1234.5678', '3')); $this->assertFalse(Validation::decimal(1234.5678, 3)); $this->assertFalse(Validation::decimal(-1234.5678, 3)); @@ -1596,8 +1596,8 @@ public function testDecimalWithPlacesNumeric() { */ public function testDecimalWithInvalidPlaces() { $this->assertFalse(Validation::decimal('.27', 'string')); - $this->assertFalse(Validation::decimal(1234.5678, (array) true)); - $this->assertFalse(Validation::decimal(-1234.5678, (object) true)); + $this->assertFalse(Validation::decimal(1234.5678, (array)true)); + $this->assertFalse(Validation::decimal(-1234.5678, (object)true)); } /**