Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyiegorov committed Nov 24, 2014
1 parent 32d51e3 commit 8efe7d5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/MainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,23 @@ public function testWrite()
mkdir($testDir, 0777);

// Write data to temporary file
$this->fileService->write('123', $path, $testDir);


// Read data from file
$data = $this->fileService->read($path);
$writtenFile = $this->fileService->write('123', $path, $testDir);

// Perform test
$this->assertEquals('123', $data, 'File service writing failed');
$this->assertStringEqualsFile($writtenFile, '123');
}

/** Test file service writing failed */
public function testFailWrite()
{
// Create temporary file
// Create path to null file
$path = __DIR__.'/test/test.txt';

// Write data to temporary file
$writtenFile = $this->fileService->write('123', $path);

// Perform test
$this->assertStringEqualsFile($writtenFile, '123');
$this->assertEquals(false, $writtenFile, '123');
}

/** Test file service deleting */
Expand Down

0 comments on commit 8efe7d5

Please sign in to comment.