mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing failing tests in auth and scaffold.
Fixing more tests that had stray buffers.
This commit is contained in:
parent
92b57d81ee
commit
2b1bc99eb5
6 changed files with 14 additions and 16 deletions
|
@ -1273,8 +1273,6 @@ class DispatcherTest extends CakeTestCase {
|
|||
|
||||
$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');
|
||||
|
@ -1378,20 +1376,20 @@ class DispatcherTest extends CakeTestCase {
|
|||
$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();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1406,7 +1404,6 @@ class DispatcherTest extends CakeTestCase {
|
|||
'js' => '',
|
||||
'css' => null
|
||||
));
|
||||
$this->assertNoErrors();
|
||||
|
||||
ob_start();
|
||||
$Dispatcher->asset('ccss/cake.generic.css');
|
||||
|
|
|
@ -37,7 +37,7 @@ class CakeRequestTestCase extends CakeTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* tearDown
|
||||
* tearDown-
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
|
|
@ -282,6 +282,8 @@ class CakeResponseTestCase extends CakeTestCase {
|
|||
$result = $response->compress();
|
||||
$this->assertTrue($result);
|
||||
$this->assertTrue(in_array('ob_gzhandler', ob_list_handlers()));
|
||||
|
||||
ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -211,6 +211,8 @@ class ClassRegistryTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
function testClassRegistryFlush() {
|
||||
$Tag = ClassRegistry::init('RegisterArticleTag');
|
||||
|
||||
$ArticleTag = ClassRegistry::getObject('RegisterArticleTag');
|
||||
$this->assertTrue(is_a($ArticleTag, 'RegisterArticleTag'));
|
||||
ClassRegistry::flush();
|
||||
|
|
|
@ -504,6 +504,7 @@ class AuthTest extends CakeTestCase {
|
|||
$this->Controller->Session->delete('Message.auth');
|
||||
|
||||
$this->initialized = true;
|
||||
Router::reload();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -299,7 +299,7 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
*/
|
||||
function tearDown() {
|
||||
parent::tearDown();
|
||||
unset($this->Controller);
|
||||
unset($this->Controller, $this->request);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -579,23 +579,21 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
* @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.
|
||||
|
@ -611,8 +609,6 @@ class ScaffoldViewTest extends CakeTestCase {
|
|||
|
||||
$this->assertPattern('#admin/scaffold_mock/edit/1#', $result);
|
||||
$this->assertPattern('#Scaffold Mock#', $result);
|
||||
|
||||
Configure::write('Routing.prefixes', $_backAdmin);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue