Skip to content

Commit a1d8186

Browse files
committed
fixes
1 parent 4a2a2e9 commit a1d8186

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

docker/bin/test.sh

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ waitForService mongo 27017 50
4040
waitForService localstack 4576 50
4141

4242
php docker/bin/refresh-mysql-database.php
43+
php pkg/job-queue/Tests/Functional/app/console doctrine:database:create --if-not-exists
44+
php pkg/job-queue/Tests/Functional/app/console doctrine:schema:update --force
4345

4446
#php pkg/enqueue-bundle/Tests/Functional/app/console.php config:dump-reference enqueue
4547
bin/phpunit "$@"

phpunit.xml.dist

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@
9898
</testsuite>
9999
</testsuites>
100100

101+
<php>
102+
<env name="SHELL_VERBOSITY" value="-1"/>
103+
</php>
104+
101105
<filter>
102106
<whitelist>
103107
<directory suffix=".php">.</directory>

pkg/job-queue/Tests/Functional/Job/JobStorageTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ public function testShouldThrowIfDuplicateJob()
138138
*/
139139
private function getEntityManager()
140140
{
141-
return $this->container->get('doctrine.orm.default_entity_manager');
141+
return static::$container->get('doctrine.orm.default_entity_manager');
142142
}
143143

144144
/**
145145
* @return \Enqueue\JobQueue\Doctrine\JobStorage
146146
*/
147147
private function getJobStorage()
148148
{
149-
return new JobStorage($this->container->get('doctrine'), Job::class, 'enqueue_job_queue_unique');
149+
return new JobStorage(static::$container->get('doctrine'), Job::class, 'enqueue_job_queue_unique');
150150
}
151151
}

pkg/job-queue/Tests/Functional/WebTestCase.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function getKernelClass()
5353
protected function startTransaction()
5454
{
5555
/** @var $em \Doctrine\ORM\EntityManager */
56-
foreach ($this->container->get('doctrine')->getManagers() as $em) {
56+
foreach (static::$container->get('doctrine')->getManagers() as $em) {
5757
$em->clear();
5858
$em->getConnection()->beginTransaction();
5959
}
@@ -64,12 +64,12 @@ protected function rollbackTransaction()
6464
//the error can be thrown during setUp
6565
//It would be caught by phpunit and tearDown called.
6666
//In this case we could not rollback since container may not exist.
67-
if (false == $this->container) {
67+
if (false == static::$container) {
6868
return;
6969
}
7070

7171
/** @var $em \Doctrine\ORM\EntityManager */
72-
foreach ($this->container->get('doctrine')->getManagers() as $em) {
72+
foreach (static::$container->get('doctrine')->getManagers() as $em) {
7373
$connection = $em->getConnection();
7474

7575
while ($connection->isTransactionActive()) {

0 commit comments

Comments
 (0)