Skip to content

Commit

Permalink
Fix tests for Symfony 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
bytehead committed Jun 7, 2018
1 parent 7dd3413 commit d0117d2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
18 changes: 9 additions & 9 deletions Tests/DependencyInjection/OneupFlysystemExtensionTest.php
Expand Up @@ -24,21 +24,21 @@ public function testVisibilitySettings()
*
* @var Filesystem $filesystem1
*/
$filesystem1 = $this->container->get('oneup_flysystem.myfilesystem_filesystem');
$filesystem1 = self::$container->get('oneup_flysystem.myfilesystem_filesystem');

/**
* Visibility flag is set to "public"
*
* @var Filesystem $filesystem2
*/
$filesystem2 = $this->container->get('oneup_flysystem.myfilesystem2_filesystem');
$filesystem2 = self::$container->get('oneup_flysystem.myfilesystem2_filesystem');

/**
* Visibility flag ist set to "private"
*
* @var Filesystem $filesystem3
*/
$filesystem3 = $this->container->get('oneup_flysystem.myfilesystem3_filesystem');
$filesystem3 = self::$container->get('oneup_flysystem.myfilesystem3_filesystem');

$filesystem1->write('1/meep', 'meep\'s content');
$filesystem2->write('2/meep', 'meep\'s content');
Expand All @@ -56,14 +56,14 @@ public function testDisableAssertsSetting()
*
* @var Filesystem $filesystem1
*/
$filesystem1 = $this->container->get('oneup_flysystem.myfilesystem_filesystem');
$filesystem1 = self::$container->get('oneup_flysystem.myfilesystem_filesystem');

/**
* Disabled asserts
*
* @var Filesystem $filesystem2
*/
$filesystem2 = $this->container->get('oneup_flysystem.myfilesystem2_filesystem');
$filesystem2 = self::$container->get('oneup_flysystem.myfilesystem2_filesystem');

$this->assertFalse($filesystem1->getConfig()->get('disable_asserts'));
$this->assertTrue($filesystem2->getConfig()->get('disable_asserts'));
Expand All @@ -72,7 +72,7 @@ public function testDisableAssertsSetting()
public function testIfMountManagerIsFilled()
{
/** @var MountManager $mountManager */
$mountManager = $this->container->get('oneup_flysystem.mount_manager');
$mountManager = self::$container->get('oneup_flysystem.mount_manager');

$this->assertInstanceOf('League\Flysystem\Filesystem', $mountManager->getFilesystem('prefix'));
}
Expand All @@ -83,7 +83,7 @@ public function testIfMountManagerIsFilled()
public function testIfOnlyConfiguredFilesystemsAreMounted()
{
/** @var MountManager $mountManager */
$mountManager = $this->container->get('oneup_flysystem.mount_manager');
$mountManager = self::$container->get('oneup_flysystem.mount_manager');

$this->assertInstanceOf('League\Flysystem\Filesystem', $mountManager->getFilesystem('prefix2'));
$this->assertInstanceOf('League\Flysystem\Filesystem', $mountManager->getFilesystem('unrelated'));
Expand Down Expand Up @@ -113,7 +113,7 @@ public function testAdapterAvailability()
*/
public function testIfCachedAdapterAreCached()
{
$filesystem = $this->container->get('oneup_flysystem.myfilesystem_filesystem');
$filesystem = self::$container->get('oneup_flysystem.myfilesystem_filesystem');
$adapter = $filesystem->getAdapter();

$this->assertInstanceOf('League\Flysystem\Cached\CachedAdapter', $adapter);
Expand Down Expand Up @@ -242,7 +242,7 @@ public function provideStreamWrapperConfigurationTests()
public function testStreamWrapperSettings()
{
/* @var StreamWrapperManager $manager */
$manager = $this->container->get('oneup_flysystem.stream_wrapper.manager');
$manager = self::$container->get('oneup_flysystem.stream_wrapper.manager');

$this->assertTrue($manager->hasConfiguration('myfilesystem'));
$this->assertInstanceOf('Oneup\FlysystemBundle\StreamWrapper\Configuration', $configuration = $manager->getConfiguration('myfilesystem'));
Expand Down
6 changes: 3 additions & 3 deletions Tests/DependencyInjection/PluginTest.php
Expand Up @@ -11,7 +11,7 @@ class PluginTest extends ContainerAwareTestCase
public function testIfSinglePluginIsAttached()
{
/** @var FilesystemInterface $filesystem */
$filesystem = $this->container->get('oneup_flysystem.myfilesystem_filesystem');
$filesystem = self::$container->get('oneup_flysystem.myfilesystem_filesystem');

$refl = new \ReflectionObject($filesystem);
$property = $refl->getProperty('plugins');
Expand All @@ -29,7 +29,7 @@ public function testIfSinglePluginIsAttached()
public function testIfAllPluginsAreAttachedCorrectly()
{
/** @var FilesystemInterface $filesystem */
$filesystem = $this->container->get('oneup_flysystem.myfilesystem2_filesystem');
$filesystem = self::$container->get('oneup_flysystem.myfilesystem2_filesystem');

$refl = new \ReflectionObject($filesystem);
$property = $refl->getProperty('plugins');
Expand All @@ -48,7 +48,7 @@ public function testIfAllPluginsAreAttachedCorrectly()
public function testIfGlobalPluginIsAttached()
{
/** @var FilesystemInterface $filesystem */
$filesystem = $this->container->get('oneup_flysystem.myfilesystem3_filesystem');
$filesystem = self::$container->get('oneup_flysystem.myfilesystem3_filesystem');

$refl = new \ReflectionObject($filesystem);
$property = $refl->getProperty('plugins');
Expand Down
5 changes: 2 additions & 3 deletions Tests/Model/ContainerAwareTestCase.php
Expand Up @@ -11,19 +11,18 @@ class ContainerAwareTestCase extends WebTestCase
* @var Client
*/
protected $client;
protected $container;
protected static $container;

public function setUp()
{
$this->client = static::createClient();
$this->container = $this->client->getContainer();
self::$container = $this->client->getContainer();
}

public function tearDown()
{
parent::tearDown();

unset($this->client);
unset($this->container);
}
}

0 comments on commit d0117d2

Please sign in to comment.