Skip to content

Commit

Permalink
Fixing failing tests in auth and scaffold.
Browse files Browse the repository at this point in the history
Fixing more tests that had stray buffers.
  • Loading branch information
markstory committed Sep 26, 2010
1 parent 92b57d8 commit 2b1bc99
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
11 changes: 4 additions & 7 deletions cake/tests/cases/dispatcher.test.php
Expand Up @@ -1273,8 +1273,6 @@ public function testAssets() {

$Dispatcher = new TestDispatcher();
$Dispatcher->response = $this->getMock('CakeResponse', array('_sendHeader'));
$debug = Configure::read('debug');
//Configure::write('debug', 0);

try {
$Dispatcher->dispatch('theme/test_theme/../webroot/css/test_asset.css');
Expand Down Expand Up @@ -1378,20 +1376,20 @@ public function testAssets() {
$result = ob_get_clean();
$expected = "alert('plugin one nested js file');";
$this->assertEqual($result, $expected);
Configure::write('debug', $debug);
//reset the


ob_start();
$Dispatcher->asset('test_plugin/css/unknown.extension');
$result = ob_get_clean();
$this->assertEqual('Testing a file with unknown extension to mime mapping.', $result);


ob_start();
$Dispatcher->asset('test_plugin/css/theme_one.htc');
$result = ob_get_clean();
$this->assertEqual('htc file', $result);

while (ob_get_level() > 0) {
ob_get_clean();
}
}

/**
Expand All @@ -1406,7 +1404,6 @@ function testMissingAssetProcessor404() {
'js' => '',
'css' => null
));
$this->assertNoErrors();

ob_start();
$Dispatcher->asset('ccss/cake.generic.css');
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/cake_request.test.php
Expand Up @@ -37,7 +37,7 @@ function setUp() {
}

/**
* tearDown
* tearDown-
*
* @return void
*/
Expand Down
2 changes: 2 additions & 0 deletions cake/tests/cases/libs/cake_response.test.php
Expand Up @@ -282,6 +282,8 @@ public function testCompress() {
$result = $response->compress();
$this->assertTrue($result);
$this->assertTrue(in_array('ob_gzhandler', ob_list_handlers()));

ob_get_clean();
}

/**
Expand Down
2 changes: 2 additions & 0 deletions cake/tests/cases/libs/class_registry.test.php
Expand Up @@ -211,6 +211,8 @@ function testAddModel() {
* @return void
*/
function testClassRegistryFlush() {
$Tag = ClassRegistry::init('RegisterArticleTag');

$ArticleTag = ClassRegistry::getObject('RegisterArticleTag');
$this->assertTrue(is_a($ArticleTag, 'RegisterArticleTag'));
ClassRegistry::flush();
Expand Down
1 change: 1 addition & 0 deletions cake/tests/cases/libs/controller/components/auth.test.php
Expand Up @@ -504,6 +504,7 @@ function setUp() {
$this->Controller->Session->delete('Message.auth');

$this->initialized = true;
Router::reload();
}

/**
Expand Down
12 changes: 4 additions & 8 deletions cake/tests/cases/libs/controller/scaffold.test.php
Expand Up @@ -299,7 +299,7 @@ function setUp() {
*/
function tearDown() {
parent::tearDown();
unset($this->Controller);
unset($this->Controller, $this->request);
}

/**
Expand Down Expand Up @@ -579,23 +579,21 @@ function testAdminIndexScaffold() {
* @return void
*/
function testAdminEditScaffold() {
$_backAdmin = Configure::read('Routing.prefixes');

Configure::write('Routing.prefixes', array('admin'));
$params = array(
'plugin' => null,
'pass' => array(),
'pass' => array(1),
'form' => array(),
'named' => array(),
'prefix' => 'admin',
'url' => array('url' =>'admin/scaffold_mock/edit'),
'url' => array('url' =>'admin/scaffold_mock/edit/1'),
'controller' => 'scaffold_mock',
'action' => 'admin_edit',
'admin' => 1,
);
$this->Controller->request->base = '';
$this->Controller->request->webroot = '/';
$this->Controller->request->here = '/admin/scaffold_mock/edit';
$this->Controller->request->here = '/admin/scaffold_mock/edit/1';
$this->Controller->request->addParams($params);

//reset, and set router.
Expand All @@ -611,8 +609,6 @@ function testAdminEditScaffold() {

$this->assertPattern('#admin/scaffold_mock/edit/1#', $result);
$this->assertPattern('#Scaffold Mock#', $result);

Configure::write('Routing.prefixes', $_backAdmin);
}

/**
Expand Down

0 comments on commit 2b1bc99

Please sign in to comment.