Use namespaced PHPUnit classes

This commit is contained in:
Jeremy Benoist 2017-12-16 22:17:42 +01:00
parent 3ccf086391
commit bd91bd5c32
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
23 changed files with 46 additions and 23 deletions

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\CoreBundle\Helper;
use Graby\Graby; use Graby\Graby;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\ConstraintViolation;
use Symfony\Component\Validator\ConstraintViolationList; use Symfony\Component\Validator\ConstraintViolationList;
@ -15,7 +16,7 @@ use Wallabag\CoreBundle\Helper\ContentProxy;
use Wallabag\CoreBundle\Helper\RuleBasedTagger; use Wallabag\CoreBundle\Helper\RuleBasedTagger;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class ContentProxyTest extends \PHPUnit_Framework_TestCase class ContentProxyTest extends TestCase
{ {
private $fetchingErrorMessage = 'wallabag can\'t retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.'; private $fetchingErrorMessage = 'wallabag can\'t retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.';

View file

@ -4,10 +4,11 @@ namespace Tests\Wallabag\CoreBundle\Helper;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger; use Psr\Log\NullLogger;
use Wallabag\CoreBundle\Helper\CryptoProxy; use Wallabag\CoreBundle\Helper\CryptoProxy;
class CryptoProxyTest extends \PHPUnit_Framework_TestCase class CryptoProxyTest extends TestCase
{ {
public function testCrypto() public function testCrypto()
{ {

View file

@ -8,9 +8,10 @@ use GuzzleHttp\Stream\Stream;
use GuzzleHttp\Subscriber\Mock; use GuzzleHttp\Subscriber\Mock;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Wallabag\CoreBundle\Helper\DownloadImages; use Wallabag\CoreBundle\Helper\DownloadImages;
class DownloadImagesTest extends \PHPUnit_Framework_TestCase class DownloadImagesTest extends TestCase
{ {
public function dataForSuccessImage() public function dataForSuccessImage()
{ {

View file

@ -2,13 +2,14 @@
namespace Tests\Wallabag\CoreBundle\Helper; namespace Tests\Wallabag\CoreBundle\Helper;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Helper\Redirect; use Wallabag\CoreBundle\Helper\Redirect;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class RedirectTest extends \PHPUnit_Framework_TestCase class RedirectTest extends TestCase
{ {
/** @var \PHPUnit_Framework_MockObject_MockObject */ /** @var \PHPUnit_Framework_MockObject_MockObject */
private $routerMock; private $routerMock;

View file

@ -4,6 +4,7 @@ namespace Tests\Wallabag\CoreBundle\Helper;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\Tag;
@ -11,7 +12,7 @@ use Wallabag\CoreBundle\Entity\TaggingRule;
use Wallabag\CoreBundle\Helper\RuleBasedTagger; use Wallabag\CoreBundle\Helper\RuleBasedTagger;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class RuleBasedTaggerTest extends \PHPUnit_Framework_TestCase class RuleBasedTaggerTest extends TestCase
{ {
private $rulerz; private $rulerz;
private $tagRepository; private $tagRepository;

View file

@ -2,13 +2,14 @@
namespace Tests\Wallabag\CoreBundle\Helper; namespace Tests\Wallabag\CoreBundle\Helper;
use PHPUnit\Framework\TestCase;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Helper\TagsAssigner; use Wallabag\CoreBundle\Helper\TagsAssigner;
use Wallabag\CoreBundle\Repository\TagRepository; use Wallabag\CoreBundle\Repository\TagRepository;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class TagsAssignerTest extends \PHPUnit_Framework_TestCase class TagsAssignerTest extends TestCase
{ {
public function testAssignTagsWithArrayAndExtraSpaces() public function testAssignTagsWithArrayAndExtraSpaces()
{ {

View file

@ -2,12 +2,13 @@
namespace Tests\Wallabag\CoreBundle\Command; namespace Tests\Wallabag\CoreBundle\Command;
use PHPUnit\Framework\TestCase;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter; use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase class UsernameRssTokenConverterTest extends TestCase
{ {
public function testSupportsWithNoRegistry() public function testSupportsWithNoRegistry()
{ {

View file

@ -2,10 +2,11 @@
namespace Tests\Wallabag\CoreBundle\Tools; namespace Tests\Wallabag\CoreBundle\Tools;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Wallabag\CoreBundle\Tools\Utils; use Wallabag\CoreBundle\Tools\Utils;
class UtilsTest extends \PHPUnit_Framework_TestCase class UtilsTest extends TestCase
{ {
/** /**
* @dataProvider examples * @dataProvider examples

View file

@ -2,9 +2,10 @@
namespace Tests\Wallabag\CoreBundle\Twig; namespace Tests\Wallabag\CoreBundle\Twig;
use PHPUnit\Framework\TestCase;
use Wallabag\CoreBundle\Twig\WallabagExtension; use Wallabag\CoreBundle\Twig\WallabagExtension;
class WallabagExtensionTest extends \PHPUnit_Framework_TestCase class WallabagExtensionTest extends TestCase
{ {
public function testRemoveWww() public function testRemoveWww()
{ {

View file

@ -3,11 +3,12 @@
namespace Tests\Wallabag\ImportBundle\Consumer\AMQP; namespace Tests\Wallabag\ImportBundle\Consumer\AMQP;
use PhpAmqpLib\Message\AMQPMessage; use PhpAmqpLib\Message\AMQPMessage;
use PHPUnit\Framework\TestCase;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Consumer\AMQPEntryConsumer; use Wallabag\ImportBundle\Consumer\AMQPEntryConsumer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class AMQPEntryConsumerTest extends \PHPUnit_Framework_TestCase class AMQPEntryConsumerTest extends TestCase
{ {
public function testMessageOk() public function testMessageOk()
{ {

View file

@ -2,11 +2,12 @@
namespace Tests\Wallabag\ImportBundle\Consumer\AMQP; namespace Tests\Wallabag\ImportBundle\Consumer\AMQP;
use PHPUnit\Framework\TestCase;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Consumer\RedisEntryConsumer; use Wallabag\ImportBundle\Consumer\RedisEntryConsumer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class RedisEntryConsumerTest extends \PHPUnit_Framework_TestCase class RedisEntryConsumerTest extends TestCase
{ {
public function testMessageOk() public function testMessageOk()
{ {

View file

@ -5,13 +5,14 @@ namespace Tests\Wallabag\ImportBundle\Import;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Import\ChromeImport; use Wallabag\ImportBundle\Import\ChromeImport;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class ChromeImportTest extends \PHPUnit_Framework_TestCase class ChromeImportTest extends TestCase
{ {
protected $user; protected $user;
protected $em; protected $em;

View file

@ -5,13 +5,14 @@ namespace Tests\Wallabag\ImportBundle\Import;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Import\FirefoxImport; use Wallabag\ImportBundle\Import\FirefoxImport;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class FirefoxImportTest extends \PHPUnit_Framework_TestCase class FirefoxImportTest extends TestCase
{ {
protected $user; protected $user;
protected $em; protected $em;

View file

@ -2,9 +2,10 @@
namespace Tests\Wallabag\ImportBundle\Import; namespace Tests\Wallabag\ImportBundle\Import;
use PHPUnit\Framework\TestCase;
use Wallabag\ImportBundle\Import\ImportChain; use Wallabag\ImportBundle\Import\ImportChain;
class ImportChainTest extends \PHPUnit_Framework_TestCase class ImportChainTest extends TestCase
{ {
public function testGetAll() public function testGetAll()
{ {

View file

@ -2,10 +2,11 @@
namespace Tests\Wallabag\ImportBundle\Import; namespace Tests\Wallabag\ImportBundle\Import;
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Wallabag\ImportBundle\Import\ImportCompilerPass; use Wallabag\ImportBundle\Import\ImportCompilerPass;
class ImportCompilerPassTest extends \PHPUnit_Framework_TestCase class ImportCompilerPassTest extends TestCase
{ {
public function testProcessNoDefinition() public function testProcessNoDefinition()
{ {

View file

@ -5,13 +5,14 @@ namespace Tests\Wallabag\ImportBundle\Import;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Import\InstapaperImport; use Wallabag\ImportBundle\Import\InstapaperImport;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class InstapaperImportTest extends \PHPUnit_Framework_TestCase class InstapaperImportTest extends TestCase
{ {
protected $user; protected $user;
protected $em; protected $em;

View file

@ -9,6 +9,7 @@ use GuzzleHttp\Subscriber\Mock;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Config; use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
@ -16,7 +17,7 @@ use Wallabag\ImportBundle\Import\PocketImport;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class PocketImportTest extends \PHPUnit_Framework_TestCase class PocketImportTest extends TestCase
{ {
protected $token; protected $token;
protected $user; protected $user;

View file

@ -5,13 +5,14 @@ namespace Tests\Wallabag\ImportBundle\Import;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Import\ReadabilityImport; use Wallabag\ImportBundle\Import\ReadabilityImport;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class ReadabilityImportTest extends \PHPUnit_Framework_TestCase class ReadabilityImportTest extends TestCase
{ {
protected $user; protected $user;
protected $em; protected $em;

View file

@ -5,13 +5,14 @@ namespace Tests\Wallabag\ImportBundle\Import;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Import\WallabagV1Import; use Wallabag\ImportBundle\Import\WallabagV1Import;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class WallabagV1ImportTest extends \PHPUnit_Framework_TestCase class WallabagV1ImportTest extends TestCase
{ {
protected $user; protected $user;
protected $em; protected $em;

View file

@ -5,13 +5,14 @@ namespace Tests\Wallabag\ImportBundle\Import;
use M6Web\Component\RedisMock\RedisMockFactory; use M6Web\Component\RedisMock\RedisMockFactory;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Simpleue\Queue\RedisQueue; use Simpleue\Queue\RedisQueue;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\ImportBundle\Import\WallabagV2Import; use Wallabag\ImportBundle\Import\WallabagV2Import;
use Wallabag\ImportBundle\Redis\Producer; use Wallabag\ImportBundle\Redis\Producer;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
class WallabagV2ImportTest extends \PHPUnit_Framework_TestCase class WallabagV2ImportTest extends TestCase
{ {
protected $user; protected $user;
protected $em; protected $em;

View file

@ -4,6 +4,7 @@ namespace Tests\Wallabag\UserBundle\EventListener;
use Monolog\Handler\TestHandler; use Monolog\Handler\TestHandler;
use Monolog\Logger; use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
@ -11,7 +12,7 @@ use Symfony\Component\Security\Core\AuthenticationEvents;
use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent; use Symfony\Component\Security\Core\Event\AuthenticationFailureEvent;
use Wallabag\UserBundle\EventListener\AuthenticationFailureListener; use Wallabag\UserBundle\EventListener\AuthenticationFailureListener;
class AuthenticationFailureListenerTest extends \PHPUnit_Framework_TestCase class AuthenticationFailureListenerTest extends TestCase
{ {
private $requestStack; private $requestStack;
private $logHandler; private $logHandler;

View file

@ -4,6 +4,7 @@ namespace Tests\Wallabag\UserBundle\EventListener;
use FOS\UserBundle\Event\FilterUserResponseEvent; use FOS\UserBundle\Event\FilterUserResponseEvent;
use FOS\UserBundle\FOSUserEvents; use FOS\UserBundle\FOSUserEvents;
use PHPUnit\Framework\TestCase;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -11,7 +12,7 @@ use Wallabag\CoreBundle\Entity\Config;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
use Wallabag\UserBundle\EventListener\CreateConfigListener; use Wallabag\UserBundle\EventListener\CreateConfigListener;
class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase class CreateConfigListenerTest extends TestCase
{ {
private $em; private $em;
private $listener; private $listener;

View file

@ -2,6 +2,7 @@
namespace Tests\Wallabag\UserBundle\Mailer; namespace Tests\Wallabag\UserBundle\Mailer;
use PHPUnit\Framework\TestCase;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
use Wallabag\UserBundle\Mailer\AuthCodeMailer; use Wallabag\UserBundle\Mailer\AuthCodeMailer;
@ -21,7 +22,7 @@ final class CountableMemorySpool extends \Swift_MemorySpool implements \Countabl
} }
} }
class AuthCodeMailerTest extends \PHPUnit_Framework_TestCase class AuthCodeMailerTest extends TestCase
{ {
protected $mailer; protected $mailer;
protected $spool; protected $spool;