Skip to content

Commit

Permalink
Fix coding standards errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 1, 2012
1 parent e8b5d81 commit d310533
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
7 changes: 4 additions & 3 deletions lib/Cake/Console/Command/Task/TestTask.php
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/BasicsTest.php
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
Expand Up @@ -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 = '<img src="http://' . $server . '/img/image.gif" alt="cool image" width="100" height="100" />';
$result = $this->CakeEmail->send();
$this->assertContains($expected, $result['message']);
Expand Down
22 changes: 11 additions & 11 deletions lib/Cake/Test/Case/Utility/ValidationTest.php
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -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));
}

/**
Expand Down

0 comments on commit d310533

Please sign in to comment.