activitypub-php/test/Config/ActivityPubModuleTest.php

41 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2019-02-14 03:27:47 +00:00
<?php /** @noinspection PhpUnhandledExceptionInspection */
namespace ActivityPub\Test\Config;
use ActivityPub\Config\ActivityPubConfig;
use ActivityPub\Config\ActivityPubModule;
use ActivityPub\Http\Router;
use ActivityPub\Test\TestConfig\APTestCase;
2019-02-16 17:51:24 +00:00
use Doctrine\ORM\EntityManager;
class ActivityPubModuleTest extends APTestCase
{
2019-02-14 03:27:47 +00:00
/**
* @var ActivityPubModule
*/
private $module;
public function setUp()
{
$config = ActivityPubConfig::createBuilder()
2019-02-16 17:51:24 +00:00
->setDbConnectionParams( array(
'driver' => 'pdo_sqlite',
'path' => ':memory:',
) )
->build();
$this->module = new ActivityPubModule( $config );
}
2019-02-16 17:51:24 +00:00
public function testItInjects()
{
$entityManager = $this->module->get( EntityManager::class );
$this->assertNotNull( $entityManager );
$this->assertInstanceOf( EntityManager::class, $entityManager );
$router = $this->module->get( Router::class );
$this->assertNotNull( $router );
$this->assertInstanceOf( Router::class, $router );
}
}