Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Unskip some tests.

  • Loading branch information...
commit 71b41ed91cef204283ed3dca105d35baf55fbc03 1 parent 457dd73
@markstory markstory authored
View
16 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
@@ -373,7 +373,8 @@ public function testImageWithTimestampping() {
* @return void
*/
public function testImageTagWithTheme() {
- $this->skipIf(!is_writable(WWW_ROOT . 'theme'), 'Cannot write to webroot/theme.');
+ $this->skipIf(!is_writable(WWW_ROOT), 'Cannot write to webroot.');
+ $themeExists = is_dir(WWW_ROOT . 'theme');
App::uses('File', 'Utility');
@@ -406,6 +407,10 @@ public function testImageTagWithTheme() {
$dir = new Folder(WWW_ROOT . 'theme' . DS . 'test_theme');
$dir->delete();
+ if (!$themeExists) {
+ $dir = new Folder(WWW_ROOT . 'theme');
+ $dir->delete();
+ }
}
/**
@@ -682,7 +687,8 @@ function testScriptAssetFilter() {
* @return void
*/
public function testScriptInTheme() {
- $this->skipIf(!is_writable(WWW_ROOT . 'theme'), 'Cannot write to webroot/theme.');
+ $this->skipIf(!is_writable(WWW_ROOT), 'Cannot write to webroot.');
+ $themeExists = is_dir(WWW_ROOT . 'theme');
App::uses('File', 'Utility');
@@ -703,7 +709,11 @@ public function testScriptInTheme() {
$Folder = new Folder(WWW_ROOT . 'theme' . DS . 'test_theme');
$Folder->delete();
- App::build();
+
+ if (!$themeExists) {
+ $dir = new Folder(WWW_ROOT . 'theme');
+ $dir->delete();
+ }
}
/**
View
41 lib/Cake/Test/Case/View/Helper/RssHelperTest.php
@@ -567,13 +567,14 @@ public function testItemCdata() {
* @return void
*/
public function testItemEnclosureLength() {
- $tmpFile = $this->_getWwwTmpFile();
-
- if (file_exists($tmpFile)) {
- unlink($tmpFile);
+ if (!is_writable(WWW_ROOT)) {
+ $this->markTestSkipped(__d('cake_dev', 'Webroot is not writable.'));
}
+ $testExists = is_dir(WWW_ROOT . 'tests');
+
+ $tmpFile = WWW_ROOT . 'tests' . DS . 'cakephp.file.test.tmp';
+ $File = new File($tmpFile, true);
- $File = new File($tmpFile, true, '0777');
$this->assertTrue($File->write('123'), 'Could not write to ' . $tmpFile);
clearstatcache(true, $tmpFile);
@@ -637,15 +638,12 @@ public function testItemEnclosureLength() {
);
$this->assertTags($result, $expected);
- unlink($tmpFile);
- }
+ $File->delete();
-/**
- * testTime method
- *
- * @return void
- */
- public function testTime() {
+ if (!$testExists) {
+ $Folder = new Folder(WWW_ROOT . 'tests');
+ $Folder->delete();
+ }
}
/**
@@ -676,21 +674,4 @@ public function testElementAttrNotInParent() {
$this->assertTags($result, $expected);
}
-/**
- * getWwwTmpFile method
- *
- * @param bool $paintSkip
- * @return void
- */
- function _getWwwTmpFile() {
- $path = WWW_ROOT . 'tests' . DS;
- $tmpFile = $path. 'cakephp.file.test.tmp';
- if (is_writable(dirname($tmpFile)) && (!file_exists($tmpFile) || is_writable($tmpFile))) {
- return $tmpFile;
- };
-
- $message = __d('cake_dev', '%s is not writeable', $path );
- $this->markTestSkipped($message);
- return false;
- }
}
Please sign in to comment.
Something went wrong with that request. Please try again.