mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Use FQCN as service name for Predis client
This commit is contained in:
parent
60777e0573
commit
a5f22ff835
14 changed files with 34 additions and 23 deletions
|
@ -164,7 +164,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
|
|||
protected function checkRedis()
|
||||
{
|
||||
try {
|
||||
$this->client->getContainer()->get('wallabag_core.redis.client')->connect();
|
||||
$this->client->getContainer()->get(\Predis\Client::class)->connect();
|
||||
} catch (\Exception $e) {
|
||||
$this->markTestSkipped('Redis is not installed/activated');
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Tests\Wallabag\ImportBundle\Command;
|
||||
|
||||
use M6Web\Component\RedisMock\RedisMockFactory;
|
||||
use Predis\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
@ -51,7 +52,7 @@ class RedisWorkerCommandTest extends WallabagCoreTestCase
|
|||
$factory = new RedisMockFactory();
|
||||
$redisMock = $factory->getAdapter('Predis\Client', true);
|
||||
|
||||
$application->getKernel()->getContainer()->set('wallabag_core.redis.client', $redisMock);
|
||||
$application->getKernel()->getContainer()->set(Client::class, $redisMock);
|
||||
|
||||
// put a fake message in the queue so the worker will stop after reading that message
|
||||
// instead of waiting for others
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -82,7 +83,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.chrome'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.chrome'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -82,7 +83,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.delicious'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.delicious'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -83,7 +84,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.elcurator'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.elcurator'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -82,7 +83,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.firefox'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.firefox'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -82,7 +83,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.instapaper'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.instapaper'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -82,7 +83,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.pinboard'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.pinboard'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -82,7 +83,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.readability'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.readability'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -83,7 +84,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.wallabag_v1'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.wallabag_v1'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests\Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Predis\Client;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||
|
||||
|
@ -83,7 +84,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
|
|||
$this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));
|
||||
$this->assertStringContainsString('flashes.import.notice.summary', $body[0]);
|
||||
|
||||
$this->assertNotEmpty($client->getContainer()->get('wallabag_core.redis.client')->lpop('wallabag.import.wallabag_v2'));
|
||||
$this->assertNotEmpty($client->getContainer()->get(Client::class)->lpop('wallabag.import.wallabag_v2'));
|
||||
|
||||
$client->getContainer()->get('craue_config')->set('import_with_redis', 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue