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