Skip to content

Commit

Permalink
Updating Folder tests for new file.
Browse files Browse the repository at this point in the history
Converting assertIdentical to assertSame.
  • Loading branch information
markstory committed Jul 23, 2011
1 parent f0819d3 commit be98e0b
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions lib/Cake/Test/Case/Utility/FolderTest.php
Expand Up @@ -342,16 +342,16 @@ public function testFolderTree() {
);

$result = $Folder->tree(CAKE . 'Config', false);
$this->assertIdentical(array_diff($expected[0], $result[0]), array());
$this->assertIdentical(array_diff($result[0], $expected[0]), array());
$this->assertSame(array_diff($expected[0], $result[0]), array());
$this->assertSame(array_diff($result[0], $expected[0]), array());

$result = $Folder->tree(CAKE . 'Config', false, 'dir');
$this->assertIdentical(array_diff($expected[0], $result), array());
$this->assertIdentical(array_diff($expected[0], $result), array());
$this->assertSame(array_diff($expected[0], $result), array());
$this->assertSame(array_diff($expected[0], $result), array());

$result = $Folder->tree(CAKE . 'Config', false, 'files');
$this->assertIdentical(array_diff($expected[1], $result), array());
$this->assertIdentical(array_diff($expected[1], $result), array());
$this->assertSame(array_diff($expected[1], $result), array());
$this->assertSame(array_diff($expected[1], $result), array());
}

/**
Expand Down Expand Up @@ -488,42 +488,42 @@ public function testFind() {
$Folder->cd(CAKE . 'Config');
$result = $Folder->find();
$expected = array('config.php');
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());

$result = $Folder->find('.*', true);
$expected = array('config.php');
$this->assertIdentical($expected, $result);
$expected = array('config.php', 'routes.php');
$this->assertSame($expected, $result);

$result = $Folder->find('.*\.php');
$expected = array('config.php');
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());

$result = $Folder->find('.*\.php', true);
$expected = array('config.php');
$this->assertIdentical($expected, $result);
$expected = array('config.php', 'routes.php');
$this->assertSame($expected, $result);

$result = $Folder->find('.*ig\.php');
$expected = array('config.php');
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$result = $Folder->find('config\.php');
$expected = array('config.php');
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$Folder->cd(TMP);
$file = new File($Folder->pwd() . DS . 'paths.php', true);
$Folder->create($Folder->pwd() . DS . 'testme');
$Folder->cd('testme');
$result = $Folder->find('paths\.php');
$expected = array();
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$Folder->cd($Folder->pwd() . '/..');
$result = $Folder->find('paths\.php');
$expected = array('paths.php');
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$Folder->cd(TMP);
$Folder->delete($Folder->pwd() . DS . 'testme');
Expand All @@ -543,14 +543,14 @@ public function testFindRecursive() {
$expected = array(
CAKE . 'Config' . DS . 'config.php'
);
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());

$result = $Folder->findRecursive('(config|paths)\.php', true);
$expected = array(
CAKE . 'Config' . DS . 'config.php'
);
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$Folder->cd(TMP);
$Folder->create($Folder->pwd() . DS . 'testme');
Expand All @@ -560,7 +560,7 @@ public function testFindRecursive() {
$Folder->cd(TMP . 'sessions');
$result = $Folder->findRecursive('paths\.php');
$expected = array();
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$Folder->cd(TMP . 'testme');
$File = new File($Folder->pwd() . DS . 'my.php');
Expand All @@ -572,15 +572,15 @@ public function testFindRecursive() {
TMP . 'testme' . DS . 'my.php',
TMP . 'testme' . DS . 'paths.php'
);
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertIdentical(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());
$this->assertSame(array_diff($expected, $result), array());

$result = $Folder->findRecursive('(paths|my)\.php', true);
$expected = array(
TMP . 'testme' . DS . 'my.php',
TMP . 'testme' . DS . 'paths.php'
);
$this->assertIdentical($expected, $result);
$this->assertSame($expected, $result);

$Folder->cd(CAKE . 'Config');
$Folder->cd(TMP);
Expand Down

0 comments on commit be98e0b

Please sign in to comment.