Permalink
Browse files

Update to assertEquals on Folder tests

  • Loading branch information...
1 parent d725869 commit 1ebaaf4dd175b94289bad54b3986184f5e72fde3 @shama shama committed Nov 15, 2011
Showing with 29 additions and 29 deletions.
  1. +29 −29 lib/Cake/Test/Case/Utility/FolderTest.php
@@ -75,15 +75,15 @@ public function testBasic() {
$Folder = new Folder($path);
$result = $Folder->pwd();
- $this->assertEqual($result, $path);
+ $this->assertEquals($result, $path);
$result = Folder::addPathElement($path, 'test');
$expected = $path . DS . 'test';
- $this->assertEqual($expected, $result);
+ $this->assertEquals($expected, $result);
$result = $Folder->cd(ROOT);
$expected = ROOT;
- $this->assertEqual($expected, $result);
+ $this->assertEquals($expected, $result);
$result = $Folder->cd(ROOT . DS . 'non-existent');
$this->assertFalse($result);
@@ -101,13 +101,13 @@ public function testInPath() {
$Folder = new Folder($path);
$result = $Folder->pwd();
- $this->assertEqual($result, $path);
+ $this->assertEquals($result, $path);
$result = Folder::isSlashTerm($inside);
$this->assertTrue($result);
$result = $Folder->realpath('Test/');
- $this->assertEqual($result, $path . DS .'Test' . DS);
+ $this->assertEquals($result, $path . DS .'Test' . DS);
$result = $Folder->inPath('Test' . DS);
$this->assertTrue($result);
@@ -230,7 +230,7 @@ public function testOperations() {
$expected = $new . ' is a file';
$result = $Folder->errors();
- $this->assertEqual($result[0], $expected);
+ $this->assertEquals($result[0], $expected);
$new = TMP . 'test_folder_new';
$result = $Folder->create($new);
@@ -277,16 +277,16 @@ public function testChmod() {
$this->assertTrue($Folder->chmod($new, 0777, true, array('skip_me.php', 'test2')));
$perms = substr(sprintf('%o', fileperms($new . DS . 'test1')), -4);
- $this->assertEqual($perms, '0777');
+ $this->assertEquals($perms, '0777');
$perms = substr(sprintf('%o', fileperms($new . DS . 'test2')), -4);
- $this->assertEqual($perms, '0755');
+ $this->assertEquals($perms, '0755');
$perms = substr(sprintf('%o', fileperms($new . DS . 'test1.php')), -4);
- $this->assertEqual($perms, '0777');
+ $this->assertEquals($perms, '0777');
$perms = substr(sprintf('%o', fileperms($new . DS . 'skip_me.php')), -4);
- $this->assertEqual($perms, '0755');
+ $this->assertEquals($perms, '0755');
$Folder->delete($new);
}
@@ -298,7 +298,7 @@ public function testChmod() {
*/
public function testRealPathForWebroot() {
$Folder = new Folder('files/');
- $this->assertEqual(realpath('files/'), $Folder->path);
+ $this->assertEquals(realpath('files/'), $Folder->path);
}
/**
@@ -313,11 +313,11 @@ public function testZeroAsDirectory() {
$result = $Folder->read(true, true);
$expected = array('0', 'cache', 'logs', 'sessions', 'tests');
- $this->assertEqual($expected, $result[0]);
+ $this->assertEquals($expected, $result[0]);
$result = $Folder->read(true, array('logs'));
$expected = array('0', 'cache', 'sessions', 'tests');
- $this->assertEqual($expected, $result[0]);
+ $this->assertEquals($expected, $result[0]);
$result = $Folder->delete($new);
$this->assertTrue($result);
@@ -330,10 +330,10 @@ public function testZeroAsDirectory() {
*/
public function testAddPathElement() {
$result = Folder::addPathElement(DS . 'some' . DS . 'dir', 'another_path');
- $this->assertEqual($result, DS . 'some' . DS . 'dir' . DS . 'another_path');
+ $this->assertEquals($result, DS . 'some' . DS . 'dir' . DS . 'another_path');
$result = Folder::addPathElement(DS . 'some' . DS . 'dir' . DS, 'another_path');
- $this->assertEqual($result, DS . 'some' . DS . 'dir' . DS . 'another_path');
+ $this->assertEquals($result, DS . 'some' . DS . 'dir' . DS . 'another_path');
}
/**
* testFolderRead method
@@ -345,12 +345,12 @@ public function testFolderRead() {
$expected = array('cache', 'logs', 'sessions', 'tests');
$result = $Folder->read(true, true);
- $this->assertEqual($result[0], $expected);
+ $this->assertEquals($result[0], $expected);
$Folder->path = TMP . 'non-existent';
$expected = array(array(), array());
$result = $Folder->read(true, true);
- $this->assertEqual($expected, $result);
+ $this->assertEquals($expected, $result);
}
/**
@@ -453,7 +453,7 @@ public function testIsSlashTerm() {
*/
public function testSlashTerm() {
$result = Folder::slashTerm('/path/to/file');
- $this->assertEqual($result, '/path/to/file/');
+ $this->assertEquals($result, '/path/to/file/');
}
/**
@@ -464,15 +464,15 @@ public function testSlashTerm() {
public function testNormalizePath() {
$path = '/path/to/file';
$result = Folder::normalizePath($path);
- $this->assertEqual($result, '/');
+ $this->assertEquals($result, '/');
$path = '\\path\\\to\\\file';
$result = Folder::normalizePath($path);
- $this->assertEqual($result, '/');
+ $this->assertEquals($result, '/');
$path = 'C:\\path\\to\\file';
$result = Folder::normalizePath($path);
- $this->assertEqual($result, '\\');
+ $this->assertEquals($result, '\\');
}
/**
@@ -483,15 +483,15 @@ public function testNormalizePath() {
public function testCorrectSlashFor() {
$path = '/path/to/file';
$result = Folder::correctSlashFor($path);
- $this->assertEqual($result, '/');
+ $this->assertEquals($result, '/');
$path = '\\path\\to\\file';
$result = Folder::correctSlashFor($path);
- $this->assertEqual($result, '/');
+ $this->assertEquals($result, '/');
$path = 'C:\\path\to\\file';
$result = Folder::correctSlashFor($path);
- $this->assertEqual($result, '\\');
+ $this->assertEquals($result, '\\');
}
/**
@@ -645,13 +645,13 @@ public function testConstructWithNonExistantPath() {
*/
public function testDirSize() {
$Folder = new Folder(TMP . 'config_non_existant', true);
- $this->assertEqual($Folder->dirSize(), 0);
+ $this->assertEquals($Folder->dirSize(), 0);
$File = new File($Folder->pwd() . DS . 'my.php', true, 0777);
$File->create();
$File->write('something here');
$File->close();
- $this->assertEqual($Folder->dirSize(), 14);
+ $this->assertEquals($Folder->dirSize(), 14);
$Folder->cd(TMP);
$Folder->delete($Folder->pwd() . 'config_non_existant');
@@ -681,7 +681,7 @@ public function testDelete() {
$path . DS . 'file2 removed',
$path . ' removed'
);
- $this->assertEqual($expected, $messages);
+ $this->assertEquals($expected, $messages);
}
/**
@@ -735,7 +735,7 @@ public function testCopy() {
$result = $Folder->copy($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
- $this->assertEqual(file_get_contents($folder3 . DS . 'folder2' . DS . 'file2.php'), 'untouched');
+ $this->assertEquals(file_get_contents($folder3 . DS . 'folder2' . DS . 'file2.php'), 'untouched');
$Folder = new Folder($path);
$Folder->delete();
@@ -809,7 +809,7 @@ public function testMove() {
$result = $Folder->move($folder3);
$this->assertTrue($result);
$this->assertTrue(file_exists($folder3 . DS . 'file1.php'));
- $this->assertEqual(file_get_contents($folder3 . DS . 'folder2' . DS . 'file2.php'), 'untouched');
+ $this->assertEquals(file_get_contents($folder3 . DS . 'folder2' . DS . 'file2.php'), 'untouched');
$this->assertFalse(file_exists($file1));
$this->assertFalse(file_exists($folder2));
$this->assertFalse(file_exists($file2));

0 comments on commit 1ebaaf4

Please sign in to comment.