Fix most code standards errors in Case/TestSuite.

This commit is contained in:
mark_story 2012-03-18 17:31:53 -04:00
parent fc234d82f1
commit 7798914676
5 changed files with 35 additions and 44 deletions

View file

@ -256,7 +256,7 @@ class CakeTestCaseTest extends CakeTestCase {
$two = "\nOne\nTwo";
$this->assertTextEquals($one, $two);
}
/**
* test assertTextStartsWith()
*
@ -265,7 +265,7 @@ class CakeTestCaseTest extends CakeTestCase {
public function testAssertTextStartsWith() {
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
$this->assertStringStartsWith("some\nstring", $stringDirty);
$this->assertStringStartsNotWith("some\r\nstring\r\nwith", $stringDirty);
$this->assertStringStartsNotWith("some\nstring\nwith", $stringDirty);
@ -282,19 +282,19 @@ class CakeTestCaseTest extends CakeTestCase {
public function testAssertTextStartsNotWith() {
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
$this->assertTextStartsNotWith("some\nstring\nwithout", $stringDirty);
}
/**
* test assertTextEndsWith()
*
* @return void
*/
*/
public function testAssertTextEndsWith() {
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
$this->assertTextEndsWith("string\nwith\r\ndifferent\rline endings!", $stringDirty);
$this->assertTextEndsWith("string\r\nwith\ndifferent\nline endings!", $stringDirty);
}
@ -303,39 +303,40 @@ class CakeTestCaseTest extends CakeTestCase {
* test assertTextEndsNotWith()
*
* @return void
*/
*/
public function testAssertTextEndsNotWith() {
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
$this->assertStringEndsNotWith("different\nline endings", $stringDirty);
$this->assertTextEndsNotWith("different\rline endings", $stringDirty);
}
/**
* test assertTextContains()
*
* @return void
*/
*/
public function testAssertTextContains() {
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
$this->assertContains("different", $stringDirty);
$this->assertNotContains("different\rline", $stringDirty);
$this->assertTextContains("different\rline", $stringDirty);
$this->assertTextContains("different\rline", $stringDirty);
}
/**
* test assertTextNotContains()
*
* @return void
*/
*/
public function testAssertTextNotContains() {
$stringDirty = "some\nstring\r\nwith\rdifferent\nline endings!";
$stringClean = "some\nstring\nwith\ndifferent\nline endings!";
$this->assertTextNotContains("different\rlines", $stringDirty);
$this->assertTextNotContains("different\rlines", $stringDirty);
}
}

View file

@ -155,15 +155,23 @@ class CakeTestFixtureDefaultImportFixture extends CakeTestFixture {
* @package Cake.Test.Case.TestSuite
*/
class FixtureImportTestModel extends Model {
public $name = 'FixtureImport';
public $useTable = 'fixture_tests';
public $useDbConfig = 'test';
}
class FixturePrefixTest extends Model {
public $name = 'FixturePrefix';
public $useTable = '_tests';
public $tablePrefix = 'fixture';
public $useDbConfig = 'test';
}
@ -218,9 +226,9 @@ class CakeTestFixtureTest extends CakeTestCase {
$this->assertEquals($Fixture->primaryKey, 'my_random_key');
}
/**
* test that init() correctly sets the fixture table when the connection or model have prefixes defined.
* test that init() correctly sets the fixture table when the connection
* or model have prefixes defined.
*
* @return void
*/
@ -359,7 +367,6 @@ class CakeTestFixtureTest extends CakeTestCase {
$Source->create($newTestSuiteDb);
$Source->insert($newTestSuiteDb);
$Fixture = new CakeTestFixtureDefaultImportFixture();
$Fixture->fields = $Fixture->records = null;
$Fixture->import = array(

View file

@ -20,24 +20,6 @@
*/
class CakeTestSuiteTest extends CakeTestCase {
/**
* setUp
*
* @return void
*/
public function setUp() {
parent::setUp();
}
/**
* tearDown
*
* @return void
*/
public function tearDown() {
parent::tearDown();
}
/**
* testAddTestDirectory
*

View file

@ -26,7 +26,6 @@ App::uses('CakeHtmlReporter', 'TestSuite/Reporter');
require_once dirname(dirname(__FILE__)) . DS . 'Model' . DS . 'models.php';
/**
* AppController class
*
@ -36,9 +35,10 @@ if (!class_exists('AppController', false)) {
/**
* AppController class
*
* @package Cake.Test.Case.TestSuite
* @package Cake.Test.Case.TestSuite
*/
class AppController extends Controller {
/**
* helpers property
*
@ -46,6 +46,7 @@ if (!class_exists('AppController', false)) {
* @access public
*/
public $helpers = array('Html');
/**
* uses property
*
@ -53,6 +54,7 @@ if (!class_exists('AppController', false)) {
* @access public
*/
public $uses = array('ControllerPost');
/**
* components property
*
@ -60,6 +62,7 @@ if (!class_exists('AppController', false)) {
* @access public
*/
public $components = array('Cookie');
}
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
@ -238,7 +241,6 @@ class ControllerTestCaseTest extends CakeTestCase {
->will($this->returnValue(false));
$this->assertTrue($Tests->TestPluginComment->save(array()));
$this->assertFalse($Tests->TestPluginComment->save(array()));
}
/**
@ -496,7 +498,7 @@ class ControllerTestCaseTest extends CakeTestCase {
$this->assertContains('This is the TestsAppsController index view', $result);
$this->assertContains('first call', $result);
$this->assertContains('</html>', $result);
$result = $this->Case->testAction('/tests_apps/index', array(
'data' => array('var' => 'second call'),
'method' => 'get',

View file

@ -21,6 +21,7 @@ App::uses('HtmlCoverageReport', 'TestSuite/Coverage');
App::uses('CakeBaseReporter', 'TestSuite/Reporter');
class HtmlCoverageReportTest extends CakeTestCase {
/**
* setUp
*
@ -127,7 +128,6 @@ class HtmlCoverageReportTest extends CakeTestCase {
}
}
/**
* Test that coverage works with phpunit 3.6 as the data formats from coverage are totally different.
*
@ -198,7 +198,6 @@ class HtmlCoverageReportTest extends CakeTestCase {
5 => -1
);
$result = $this->Coverage->generateDiff('myfile.php', $file, $coverage);
$this->assertTrue(