Fix tests

This commit is contained in:
Jeremy Dormitzer 2019-02-16 12:57:26 -05:00
parent 510df450e9
commit f7b42c3006
4 changed files with 26 additions and 4 deletions

View File

@ -94,7 +94,9 @@ class ActivityPubModule
->addArgument( new Reference( AuthService::class ) ) ->addArgument( new Reference( AuthService::class ) )
->addArgument( new Reference( ContextProvider::class ) ) ->addArgument( new Reference( ContextProvider::class ) )
->addArgument( new Reference( Client::class ) ) ->addArgument( new Reference( Client::class ) )
->addArgument( new Reference( SimpleDateTimeProvider::class ) ); ->addArgument( new Reference( SimpleDateTimeProvider::class ) )
->addArgument( new Reference( EntityManager::class ) )
->addArgument( new Reference( ObjectsService::class ) );
$this->injector->register( RandomProvider::class, RandomProvider::class ); $this->injector->register( RandomProvider::class, RandomProvider::class );

View File

@ -13,6 +13,7 @@ use ActivityPub\Objects\ObjectsService;
use ActivityPub\Test\TestConfig\APTestCase; use ActivityPub\Test\TestConfig\APTestCase;
use ActivityPub\Test\TestUtils\TestActivityPubObject; use ActivityPub\Test\TestUtils\TestActivityPubObject;
use ActivityPub\Utils\SimpleDateTimeProvider; use ActivityPub\Utils\SimpleDateTimeProvider;
use Doctrine\ORM\EntityManager;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -35,7 +36,9 @@ class CreateHandlerTest extends APTestCase
$this->getMock( AuthService::class ), $this->getMock( AuthService::class ),
new ContextProvider(), new ContextProvider(),
$this->getMock( Client::class ), $this->getMock( Client::class ),
new SimpleDateTimeProvider() new SimpleDateTimeProvider(),
$this->getMock( EntityManager::class ),
$objectsService
); );
$createHandler = new CreateHandler( $createHandler = new CreateHandler(
$objectsService, $idProvider, $collectionsService $objectsService, $idProvider, $collectionsService

View File

@ -10,6 +10,7 @@ use ActivityPub\Objects\ObjectsService;
use ActivityPub\Test\TestConfig\APTestCase; use ActivityPub\Test\TestConfig\APTestCase;
use ActivityPub\Test\TestUtils\TestActivityPubObject; use ActivityPub\Test\TestUtils\TestActivityPubObject;
use ActivityPub\Utils\SimpleDateTimeProvider; use ActivityPub\Utils\SimpleDateTimeProvider;
use Doctrine\ORM\EntityManager;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@ -42,7 +43,13 @@ class GetControllerTest extends APTestCase
$contextProvider = new ContextProvider(); $contextProvider = new ContextProvider();
$httpClient = $this->getMock( Client::class ); $httpClient = $this->getMock( Client::class );
$collectionsService = new CollectionsService( $collectionsService = new CollectionsService(
4, $authService, $contextProvider, $httpClient, new SimpleDateTimeProvider() 4,
$authService,
$contextProvider,
$httpClient,
new SimpleDateTimeProvider(),
$this->getMock( EntityManager::class ),
$objectsService
); );
$this->getController = new GetController( $this->getController = new GetController(
$objectsService, $collectionsService, $authService $objectsService, $collectionsService, $authService

View File

@ -5,9 +5,11 @@ namespace ActivityPub\Test\Objects;
use ActivityPub\Auth\AuthService; use ActivityPub\Auth\AuthService;
use ActivityPub\Objects\CollectionsService; use ActivityPub\Objects\CollectionsService;
use ActivityPub\Objects\ContextProvider; use ActivityPub\Objects\ContextProvider;
use ActivityPub\Objects\ObjectsService;
use ActivityPub\Test\TestConfig\APTestCase; use ActivityPub\Test\TestConfig\APTestCase;
use ActivityPub\Test\TestUtils\TestActivityPubObject; use ActivityPub\Test\TestUtils\TestActivityPubObject;
use ActivityPub\Utils\SimpleDateTimeProvider; use ActivityPub\Utils\SimpleDateTimeProvider;
use Doctrine\ORM\EntityManager;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Response as Psr7Response; use GuzzleHttp\Psr7\Response as Psr7Response;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -34,8 +36,16 @@ class CollectionsServiceTest extends APTestCase
), ),
) ) ) ) ) )
); );
$entityManager = $this->getMock( EntityManager::class );
$objectsService = $this->getMock( ObjectsService::class );
$this->collectionsService = new CollectionsService( $this->collectionsService = new CollectionsService(
4, $authService, $contextProvider, $httpClient, new SimpleDateTimeProvider() 4,
$authService,
$contextProvider,
$httpClient,
new SimpleDateTimeProvider(),
$entityManager,
$objectsService
); );
} }