class FlysystemPathProcessorTest in Flysystem 2.0.x
Same name and namespace in other branches
- 8 tests/src/Unit/PathProcessor/FlysystemPathProcessorTest.php \Drupal\Tests\flysystem\Unit\PathProcessor\FlysystemPathProcessorTest
- 3.x tests/src/Unit/PathProcessor/FlysystemPathProcessorTest.php \Drupal\Tests\flysystem\Unit\PathProcessor\FlysystemPathProcessorTest
- 3.0.x tests/src/Unit/PathProcessor/FlysystemPathProcessorTest.php \Drupal\Tests\flysystem\Unit\PathProcessor\FlysystemPathProcessorTest
@coversDefaultClass \Drupal\flysystem\PathProcessor\FlysystemPathProcessor @group flysystem
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, PhpUnitCompatibilityTrait, PhpUnitWarnings
- class \Drupal\Tests\flysystem\Unit\PathProcessor\FlysystemPathProcessorTest
Expanded class hierarchy of FlysystemPathProcessorTest
File
- tests/
src/ Unit/ PathProcessor/ FlysystemPathProcessorTest.php, line 13
Namespace
Drupal\Tests\flysystem\Unit\PathProcessorView source
class FlysystemPathProcessorTest extends UnitTestCase {
/**
* @covers ::processInbound
*/
public function testCorrectPathsAreProccessed() {
$processor = new FlysystemPathProcessor();
$this
->assertSame('beep', $processor
->processInbound('beep', new Request()));
$this
->assertSame('/_flysystem/scheme', $processor
->processInbound('/_flysystem/scheme', new Request()));
}
/**
* @covers ::processInbound
*/
public function testImageStylesAreProccessed() {
$request = new Request();
$processor = new FlysystemPathProcessor();
$this
->assertSame('/_flysystem/styles/scheme/small', $processor
->processInbound('/_flysystem/scheme/styles/scheme/small/image.jpg', $request));
$this
->assertSame($request->query
->get('file'), 'image.jpg');
$this
->assertSame('/_flysystem/styles/scheme/small', $processor
->processInbound('/_flysystem/scheme/styles/scheme/small/dir/image.jpg', $request));
$this
->assertSame($request->query
->get('file'), 'dir/image.jpg');
}
/**
* @covers ::processInbound
*/
public function testDownloadPathsAreProccessed() {
$request = new Request();
$processor = new FlysystemPathProcessor();
$this
->assertSame('/_flysystem/scheme', $processor
->processInbound('/_flysystem/scheme/file.txt', $request));
$this
->assertSame('file.txt', $request->query
->get('file'));
}
/**
* @covers ::processInbound
*/
public function testDownloadPathsInSubDirsAreProccessed() {
$request = new Request();
$processor = new FlysystemPathProcessor();
$this
->assertSame('/_flysystem/scheme', $processor
->processInbound('/_flysystem/scheme/a/b/c/file.txt', $request));
$this
->assertSame('a/b/c/file.txt', $request->query
->get('file'));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FlysystemPathProcessorTest:: |
public | function | @covers ::processInbound | |
FlysystemPathProcessorTest:: |
public | function | @covers ::processInbound | |
FlysystemPathProcessorTest:: |
public | function | @covers ::processInbound | |
FlysystemPathProcessorTest:: |
public | function | @covers ::processInbound | |
PhpUnitWarnings:: |
private static | property | Deprecation warnings from PHPUnit to raise with @trigger_error(). | |
PhpUnitWarnings:: |
public | function | Converts PHPUnit deprecation warnings to E_USER_DEPRECATED. | |
UnitTestCase:: |
protected | property | The random generator. | |
UnitTestCase:: |
protected | property | The app root. | 1 |
UnitTestCase:: |
protected | function | Asserts if two arrays are equal by sorting them first. | |
UnitTestCase:: |
protected | function | Returns a stub class resolver. | |
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
protected | function | Sets up a container with a cache tags invalidator. | |
UnitTestCase:: |
protected | function | Gets the random generator for the utility methods. | |
UnitTestCase:: |
public | function | Returns a stub translation manager that just returns the passed string. | |
UnitTestCase:: |
public | function | Generates a unique random string containing letters and numbers. | |
UnitTestCase:: |
protected | function | 308 | |
UnitTestCase:: |
public static | function |