mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Fix CS
This commit is contained in:
@@ -4,7 +4,6 @@ namespace Alchemy\Tests\Phrasea\Model\Manipulator;
|
||||
|
||||
use Alchemy\Phrasea\Controller\Api\V1;
|
||||
use Alchemy\Phrasea\Model\Manipulator\ApiAccountManipulator;
|
||||
use Alchemy\Phrasea\Model\Entities\ApiApplication;
|
||||
|
||||
class ApiAccountManipulatorTest extends \PhraseanetTestCase
|
||||
{
|
||||
|
@@ -24,7 +24,7 @@ class ApiLogManipulatorTest extends \PhraseanetTestCase
|
||||
*/
|
||||
public function testsLogHydration($path, $expected)
|
||||
{
|
||||
$emMock = $this->getMock('\Doctrine\ORM\EntityManager', array('persist', 'flush'), array(), '', false);
|
||||
$emMock = $this->getMock('\Doctrine\ORM\EntityManager', ['persist', 'flush'], [], '', false);
|
||||
$account = $this->getMock('\Alchemy\Phrasea\Model\Entities\ApiAccount');
|
||||
$manipulator = new ApiLogManipulator($emMock, self::$DI['app']['repo.api-logs']);
|
||||
$log = $manipulator->create($account, Request::create($path, 'POST'), new Response());
|
||||
|
@@ -2,11 +2,8 @@
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Model\Manipulator;
|
||||
|
||||
|
||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||
use Alchemy\Phrasea\Model\Manipulator\ApiOauthCodeManipulator;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class ApiOauthCodeManipulatorTest extends \PhraseanetTestCase
|
||||
{
|
||||
|
@@ -2,10 +2,7 @@
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Model\Manipulator;
|
||||
|
||||
use Alchemy\Phrasea\Model\Manipulator\ApiLogManipulator;
|
||||
use Alchemy\Phrasea\Model\Manipulator\ApiOauthTokenManipulator;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class ApiOauthTokenManipulatorTest extends \PhraseanetTestCase
|
||||
{
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Model\Manipulator;
|
||||
|
||||
use Alchemy\Phrasea\Controller\Api\V1;
|
||||
use Alchemy\Phrasea\Model\Manipulator\WebhookEventDeliveryManipulator;
|
||||
use Alchemy\Phrasea\Model\Entities\WebhookEventDelivery;
|
||||
use Alchemy\Phrasea\Model\Manipulator\ApiApplicationManipulator;
|
||||
use Alchemy\Phrasea\Model\Entities\ApiApplication;
|
||||
|
||||
|
@@ -3,7 +3,6 @@
|
||||
namespace Alchemy\Tests\Phrasea\Model\Manipulator;
|
||||
|
||||
use Alchemy\Phrasea\Model\Manipulator\WebhookEventManipulator;
|
||||
use Alchemy\Phrasea\Model\Entities\WebhookEventDelivery;
|
||||
use Alchemy\Phrasea\Model\Entities\WebhookEvent;
|
||||
|
||||
class WebhookEventManipulatorTest extends \PhraseanetTestCase
|
||||
@@ -12,18 +11,18 @@ class WebhookEventManipulatorTest extends \PhraseanetTestCase
|
||||
{
|
||||
$manipulator = new WebhookEventManipulator(self::$DI['app']['EM'], self::$DI['app']['repo.webhook-delivery']);
|
||||
$nbEvents = count(self::$DI['app']['repo.webhook-event']->findAll());
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, array(
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, [
|
||||
'feed_id' => self::$DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => self::$DI['feed_public_entry']->getId()
|
||||
));
|
||||
]);
|
||||
$this->assertGreaterThan($nbEvents, count(self::$DI['app']['repo.webhook-event']->findAll()));
|
||||
}
|
||||
|
||||
public function testDelete()
|
||||
{
|
||||
$manipulator = new WebhookEventManipulator(self::$DI['app']['EM'], self::$DI['app']['repo.webhook-event']);
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, array(
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, [
|
||||
'feed_id' => self::$DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => self::$DI['feed_public_entry']->getId()
|
||||
));
|
||||
]);
|
||||
$countBefore = count(self::$DI['app']['repo.webhook-event']->findAll());
|
||||
$manipulator->delete($event);
|
||||
$this->assertGreaterThan(count(self::$DI['app']['repo.webhook-event']->findAll()), $countBefore);
|
||||
@@ -32,9 +31,9 @@ class WebhookEventManipulatorTest extends \PhraseanetTestCase
|
||||
public function testUpdate()
|
||||
{
|
||||
$manipulator = new WebhookEventManipulator(self::$DI['app']['EM'], self::$DI['app']['repo.webhook-event']);
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, array(
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, [
|
||||
'feed_id' => self::$DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => self::$DI['feed_public_entry']->getId()
|
||||
));
|
||||
]);
|
||||
$event->setProcessed(true);
|
||||
$manipulator->update($event);
|
||||
$event = self::$DI['app']['repo.webhook-event']->find($event->getId());
|
||||
@@ -44,9 +43,9 @@ class WebhookEventManipulatorTest extends \PhraseanetTestCase
|
||||
public function testProcessed()
|
||||
{
|
||||
$manipulator = new WebhookEventManipulator(self::$DI['app']['EM'], self::$DI['app']['repo.webhook-event']);
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, array(
|
||||
$event = $manipulator->create(WebhookEvent::NEW_FEED_ENTRY, WebhookEvent::FEED_ENTRY_TYPE, [
|
||||
'feed_id' => self::$DI['feed_public_entry']->getFeed()->getId(), 'entry_id' => self::$DI['feed_public_entry']->getId()
|
||||
));
|
||||
]);
|
||||
$manipulator->processed($event);
|
||||
$this->assertTrue($event->isProcessed());
|
||||
}
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Model\Repositories;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\ApiApplication;
|
||||
|
||||
class ApiOauthCodeRepositoryTest extends \PhraseanetTestCase
|
||||
{
|
||||
public function testFindByAccount()
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Model\Repositories;
|
||||
|
||||
use Alchemy\Phrasea\Model\Entities\ApiApplication;
|
||||
|
||||
class ApiOauthTokenRepositoryTest extends \PhraseanetTestCase
|
||||
{
|
||||
public function testFindDeveloperToken()
|
||||
|
Reference in New Issue
Block a user