mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Updating Folder tests for new file.
Converting assertIdentical to assertSame.
This commit is contained in:
parent
f0819d364c
commit
be98e0b962
1 changed files with 25 additions and 25 deletions
|
@ -342,16 +342,16 @@ class FolderTest extends CakeTestCase {
|
||||||
);
|
);
|
||||||
|
|
||||||
$result = $Folder->tree(CAKE . 'Config', false);
|
$result = $Folder->tree(CAKE . 'Config', false);
|
||||||
$this->assertIdentical(array_diff($expected[0], $result[0]), array());
|
$this->assertSame(array_diff($expected[0], $result[0]), array());
|
||||||
$this->assertIdentical(array_diff($result[0], $expected[0]), array());
|
$this->assertSame(array_diff($result[0], $expected[0]), array());
|
||||||
|
|
||||||
$result = $Folder->tree(CAKE . 'Config', false, 'dir');
|
$result = $Folder->tree(CAKE . 'Config', false, 'dir');
|
||||||
$this->assertIdentical(array_diff($expected[0], $result), array());
|
$this->assertSame(array_diff($expected[0], $result), array());
|
||||||
$this->assertIdentical(array_diff($expected[0], $result), array());
|
$this->assertSame(array_diff($expected[0], $result), array());
|
||||||
|
|
||||||
$result = $Folder->tree(CAKE . 'Config', false, 'files');
|
$result = $Folder->tree(CAKE . 'Config', false, 'files');
|
||||||
$this->assertIdentical(array_diff($expected[1], $result), array());
|
$this->assertSame(array_diff($expected[1], $result), array());
|
||||||
$this->assertIdentical(array_diff($expected[1], $result), array());
|
$this->assertSame(array_diff($expected[1], $result), array());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -488,29 +488,29 @@ class FolderTest extends CakeTestCase {
|
||||||
$Folder->cd(CAKE . 'Config');
|
$Folder->cd(CAKE . 'Config');
|
||||||
$result = $Folder->find();
|
$result = $Folder->find();
|
||||||
$expected = array('config.php');
|
$expected = array('config.php');
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
|
|
||||||
$result = $Folder->find('.*', true);
|
$result = $Folder->find('.*', true);
|
||||||
$expected = array('config.php');
|
$expected = array('config.php', 'routes.php');
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$result = $Folder->find('.*\.php');
|
$result = $Folder->find('.*\.php');
|
||||||
$expected = array('config.php');
|
$expected = array('config.php');
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
|
|
||||||
$result = $Folder->find('.*\.php', true);
|
$result = $Folder->find('.*\.php', true);
|
||||||
$expected = array('config.php');
|
$expected = array('config.php', 'routes.php');
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$result = $Folder->find('.*ig\.php');
|
$result = $Folder->find('.*ig\.php');
|
||||||
$expected = array('config.php');
|
$expected = array('config.php');
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$result = $Folder->find('config\.php');
|
$result = $Folder->find('config\.php');
|
||||||
$expected = array('config.php');
|
$expected = array('config.php');
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$Folder->cd(TMP);
|
$Folder->cd(TMP);
|
||||||
$file = new File($Folder->pwd() . DS . 'paths.php', true);
|
$file = new File($Folder->pwd() . DS . 'paths.php', true);
|
||||||
|
@ -518,12 +518,12 @@ class FolderTest extends CakeTestCase {
|
||||||
$Folder->cd('testme');
|
$Folder->cd('testme');
|
||||||
$result = $Folder->find('paths\.php');
|
$result = $Folder->find('paths\.php');
|
||||||
$expected = array();
|
$expected = array();
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$Folder->cd($Folder->pwd() . '/..');
|
$Folder->cd($Folder->pwd() . '/..');
|
||||||
$result = $Folder->find('paths\.php');
|
$result = $Folder->find('paths\.php');
|
||||||
$expected = array('paths.php');
|
$expected = array('paths.php');
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$Folder->cd(TMP);
|
$Folder->cd(TMP);
|
||||||
$Folder->delete($Folder->pwd() . DS . 'testme');
|
$Folder->delete($Folder->pwd() . DS . 'testme');
|
||||||
|
@ -543,14 +543,14 @@ class FolderTest extends CakeTestCase {
|
||||||
$expected = array(
|
$expected = array(
|
||||||
CAKE . 'Config' . DS . 'config.php'
|
CAKE . 'Config' . DS . 'config.php'
|
||||||
);
|
);
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
|
|
||||||
$result = $Folder->findRecursive('(config|paths)\.php', true);
|
$result = $Folder->findRecursive('(config|paths)\.php', true);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
CAKE . 'Config' . DS . 'config.php'
|
CAKE . 'Config' . DS . 'config.php'
|
||||||
);
|
);
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$Folder->cd(TMP);
|
$Folder->cd(TMP);
|
||||||
$Folder->create($Folder->pwd() . DS . 'testme');
|
$Folder->create($Folder->pwd() . DS . 'testme');
|
||||||
|
@ -560,7 +560,7 @@ class FolderTest extends CakeTestCase {
|
||||||
$Folder->cd(TMP . 'sessions');
|
$Folder->cd(TMP . 'sessions');
|
||||||
$result = $Folder->findRecursive('paths\.php');
|
$result = $Folder->findRecursive('paths\.php');
|
||||||
$expected = array();
|
$expected = array();
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$Folder->cd(TMP . 'testme');
|
$Folder->cd(TMP . 'testme');
|
||||||
$File = new File($Folder->pwd() . DS . 'my.php');
|
$File = new File($Folder->pwd() . DS . 'my.php');
|
||||||
|
@ -572,15 +572,15 @@ class FolderTest extends CakeTestCase {
|
||||||
TMP . 'testme' . DS . 'my.php',
|
TMP . 'testme' . DS . 'my.php',
|
||||||
TMP . 'testme' . DS . 'paths.php'
|
TMP . 'testme' . DS . 'paths.php'
|
||||||
);
|
);
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
$this->assertIdentical(array_diff($expected, $result), array());
|
$this->assertSame(array_diff($expected, $result), array());
|
||||||
|
|
||||||
$result = $Folder->findRecursive('(paths|my)\.php', true);
|
$result = $Folder->findRecursive('(paths|my)\.php', true);
|
||||||
$expected = array(
|
$expected = array(
|
||||||
TMP . 'testme' . DS . 'my.php',
|
TMP . 'testme' . DS . 'my.php',
|
||||||
TMP . 'testme' . DS . 'paths.php'
|
TMP . 'testme' . DS . 'paths.php'
|
||||||
);
|
);
|
||||||
$this->assertIdentical($expected, $result);
|
$this->assertSame($expected, $result);
|
||||||
|
|
||||||
$Folder->cd(CAKE . 'Config');
|
$Folder->cd(CAKE . 'Config');
|
||||||
$Folder->cd(TMP);
|
$Folder->cd(TMP);
|
||||||
|
|
Loading…
Add table
Reference in a new issue