Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ian Jenkins
committed
Mar 8, 2016
1 parent
b432a6e
commit 4620f98
Showing
3 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
/** | ||
* @group integration | ||
*/ | ||
class GaufretteLocalAdapterTest extends PHPUnit_Framework_TestCase | ||
{ | ||
private $local; | ||
|
||
protected function setUp() | ||
{ | ||
$this->local = new \Jenko\Flysystem\GaufretteAdapter( | ||
new \Gaufrette\Adapter\Local(__DIR__ . '/resources') | ||
); | ||
} | ||
|
||
protected function tearDown() | ||
{ | ||
array_map('unlink', glob(__DIR__ . '/resources/*')); | ||
} | ||
|
||
public function testLocalAdapter() | ||
{ | ||
$filesystem = new \League\Flysystem\Filesystem($this->local); | ||
|
||
$written = $filesystem->write('test.txt', 'foo'); | ||
$this->assertTrue($written); | ||
|
||
$data = $filesystem->read('test.txt'); | ||
|
||
$this->assertEquals('foo', $data); | ||
} | ||
|
||
public function testHadouken() | ||
{ | ||
$local = new \Jenko\Flysystem\GaufretteAdapter( | ||
new \Gaufrette\Adapter\Flysystem( | ||
new \Jenko\Flysystem\GaufretteAdapter( | ||
new \Gaufrette\Adapter\Flysystem( | ||
new \Jenko\Flysystem\GaufretteAdapter( | ||
new \Gaufrette\Adapter\Flysystem( | ||
new \Jenko\Flysystem\GaufretteAdapter( | ||
new \Gaufrette\Adapter\Local( | ||
__DIR__ . '/resources' | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
); | ||
|
||
$filesystem = new \League\Flysystem\Filesystem($local); | ||
|
||
$written = $filesystem->write('test.txt', 'foo'); | ||
$this->assertTrue($written); | ||
|
||
$data = $filesystem->read('test.txt'); | ||
|
||
$this->assertEquals('foo', $data); | ||
} | ||
} |