Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Lechat committed Nov 15, 2017
1 parent 294add9 commit f749e99
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/DataCollector/StandardDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,17 @@ public function testCollect()
$this->assertEquals(1, $collector->getQueryCount());
$this->assertEquals(['{"foo":"bar"}'], $collector->getQueries());
}

public function testReset()
{
$collector = new StandardDataCollector();
$collector->logQuery(['foo' => 'bar']);
$collector->collect(new Request(), new Response());

$collector->reset();
$collector->collect(new Request(), new Response());

$this->assertEquals([], $collector->getQueries());
$this->assertEquals(0, $collector->getQueryCount());
}
}
10 changes: 10 additions & 0 deletions Tests/DependencyInjection/DoctrineMongoDBExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,4 +225,14 @@ public function testFactoriesAreRegistered()
[new Reference('persistent_collection_factory_service')]
], $configDm1->getMethodCalls());
}

public function testPublicServicesAndAliases()
{
$loader = new DoctrineMongoDBExtension();
$loader->load(self::buildConfiguration(), $container = $this->buildMinimalContainer());

$this->assertTrue($container->getDefinition('doctrine_mongodb')->isPublic());
$this->assertTrue($container->getDefinition('doctrine_mongodb.odm.dummy_document_manager')->isPublic());
$this->assertTrue($container->getAlias('doctrine_mongodb.odm.document_manager')->isPublic());
}
}

0 comments on commit f749e99

Please sign in to comment.