Skip to content

Commit

Permalink
return upload catalog in write()
Browse files Browse the repository at this point in the history
  • Loading branch information
onysko committed Nov 26, 2014
1 parent 4d9f314 commit 5315c7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/LocalFileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function write($data, $filename = '', $uploadDir = '')

// Put file and return true if at least one byte is written
if (file_put_contents($path, $data) !== false) {
return $uploadDir.'/'.$filename;
return $uploadDir.'/';
} else { // We have failed my lord..
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/MainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public function testWrite()
mkdir($testDir, 0777);

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

// Perform test
$this->assertStringEqualsFile($writtenFile, '123');
$this->assertStringEqualsFile($writtenPath.basename($path), '123');
}

/** Test file service writing failed */
Expand All @@ -54,10 +54,10 @@ public function testFailWrite()
$path = __DIR__.'/test/test.txt';

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

// Perform test
$this->assertEquals(false, $writtenFile, '123');
$this->assertEquals(false, $writtenPath.basename($path), '123');
}

/** Test file service deleting */
Expand Down

0 comments on commit 5315c7f

Please sign in to comment.