Skip to content
Permalink
Browse files

Define code coverage explicitly

  • Loading branch information...
ravage84 committed Jun 14, 2015
1 parent c47196f commit f3099fefdff4fdf1b0facc47ea0df27482a4804b
Showing with 34 additions and 0 deletions.
  1. +34 −0 lib/Cake/Test/Case/Utility/FileTest.php
@@ -23,6 +23,7 @@
* FileTest class
*
* @package Cake.Test.Case.Utility
* @coversDefaultClass File
*/
class FileTest extends CakeTestCase {
@@ -62,6 +63,15 @@ public function tearDown() {
* testBasic method
*
* @return void
* @covers ::__construct
* @covers ::info
* @covers ::ext
* @covers ::name
* @covers ::md5
* @covers ::size
* @covers ::owner
* @covers ::group
* @covers ::Folder
*/
public function testBasic() {
$file = CAKE . DS . 'LICENSE.txt';
@@ -126,6 +136,7 @@ function_exists('mime_content_type') &&
* testPermission method
*
* @return void
* @covers ::perms
*/
public function testPermission() {
$this->skipIf(DIRECTORY_SEPARATOR === '\\', 'File permissions tests not supported on Windows.');
@@ -172,6 +183,7 @@ public function testPermission() {
* testRead method
*
* @return void
* @covers ::read
*/
public function testRead() {
$file = __FILE__;
@@ -203,6 +215,7 @@ public function testRead() {
* testOffset method
*
* @return void
* @covers ::offset
*/
public function testOffset() {
$this->File->close();
@@ -235,6 +248,7 @@ public function testOffset() {
* testOpen method
*
* @return void
* @covers ::open
*/
public function testOpen() {
$this->File->handle = null;
@@ -259,6 +273,7 @@ public function testOpen() {
* testClose method
*
* @return void
* @covers ::close
*/
public function testClose() {
$this->File->handle = null;
@@ -276,6 +291,9 @@ public function testClose() {
* testCreate method
*
* @return void
* @covers ::create
* @covers ::exists
* @covers ::clearStatCache
*/
public function testCreate() {
$tmpFile = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
@@ -287,6 +305,8 @@ public function testCreate() {
* testOpeningNonExistentFileCreatesIt method
*
* @return void
* @covers ::open
* @covers ::create
*/
public function testOpeningNonExistentFileCreatesIt() {
$someFile = new File(TMP . 'some_file.txt', false);
@@ -300,6 +320,7 @@ public function testOpeningNonExistentFileCreatesIt() {
* testPrepare method
*
* @return void
* @covers ::prepare
*/
public function testPrepare() {
$string = "some\nvery\ncool\r\nteststring here\n\n\nfor\r\r\n\n\r\n\nhere";
@@ -320,6 +341,7 @@ public function testPrepare() {
* testReadable method
*
* @return void
* @covers ::readable
*/
public function testReadable() {
$someFile = new File(TMP . 'some_file.txt', false);
@@ -333,6 +355,7 @@ public function testReadable() {
* testWritable method
*
* @return void
* @covers ::writable
*/
public function testWritable() {
$someFile = new File(TMP . 'some_file.txt', false);
@@ -346,6 +369,7 @@ public function testWritable() {
* testExecutable method
*
* @return void
* @covers ::executable
*/
public function testExecutable() {
$someFile = new File(TMP . 'some_file.txt', false);
@@ -359,6 +383,7 @@ public function testExecutable() {
* testLastAccess method
*
* @return void
* @covers ::lastAccess
*/
public function testLastAccess() {
$someFile = new File(TMP . 'some_file.txt', false);
@@ -373,6 +398,7 @@ public function testLastAccess() {
* testLastChange method
*
* @return void
* @covers ::lastChange
*/
public function testLastChange() {
$someFile = new File(TMP . 'some_file.txt', false);
@@ -391,6 +417,7 @@ public function testLastChange() {
* testWrite method
*
* @return void
* @covers ::write
*/
public function testWrite() {
if (!$tmpFile = $this->_getTmpFile()) {
@@ -421,6 +448,7 @@ public function testWrite() {
* testAppend method
*
* @return void
* @covers ::append
*/
public function testAppend() {
if (!$tmpFile = $this->_getTmpFile()) {
@@ -457,6 +485,7 @@ public function testAppend() {
* testDelete method
*
* @return void
* @covers ::delete
*/
public function testDelete() {
if (!$tmpFile = $this->_getTmpFile()) {
@@ -482,6 +511,7 @@ public function testDelete() {
* active filehandles open.
*
* @return void
* @covers ::delete
*/
public function testDeleteAfterRead() {
if (!$tmpFile = $this->_getTmpFile()) {
@@ -499,6 +529,7 @@ public function testDeleteAfterRead() {
* testCopy method
*
* @return void
* @covers ::copy
*/
public function testCopy() {
$dest = TMP . 'tests' . DS . 'cakephp.file.test.tmp';
@@ -527,6 +558,7 @@ public function testCopy() {
* Test mime()
*
* @return void
* @covers ::mime
*/
public function testMime() {
$this->skipIf(!function_exists('finfo_open') && !function_exists('mime_content_type'), 'Not able to read mime type');
@@ -566,6 +598,7 @@ protected function _getTmpFile($paintSkip = true) {
* testReplaceText method
*
* @return void
* @covers ::replaceText
*/
public function testReplaceText() {
$TestFile = new File(dirname(__FILE__) . '/../../test_app/Vendor/welcome.php');
@@ -603,6 +636,7 @@ public function testReplaceText() {
* do not exist.
*
* @return void
* @covers ::pwd
*/
public function testNoPartialPathBeingSetForNonExistentPath() {
$tmpFile = new File('/non/existent/file');

0 comments on commit f3099fe

Please sign in to comment.
You can’t perform that action at this time.