Skip to content

Commit

Permalink
Update travis and fix warnings in build
Browse files Browse the repository at this point in the history
  • Loading branch information
Daan Biesterbos committed Mar 11, 2021
1 parent af85b78 commit 7792fed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ language: php

sudo: false

env:
- XDEBUG_MODE=coverage

cache:
directories:
- $HOME/.composer/cache
Expand All @@ -15,8 +18,9 @@ matrix:
before_script:
- composer self-update
- echo "memory_limit=3G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "xdebug.mode=coverage" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

install: composer install --dev
install: composer install

script: phpunit --coverage-clover clover

Expand Down
35 changes: 16 additions & 19 deletions Tests/Functional/JobManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ public function testCloseJob()
$this->em->persist($b);
$this->em->flush();

$this->dispatcher->expects($this->at(0))
$this->dispatcher->expects(self::exactly(2))
->method('dispatch')
->with(new StateChangeEvent($a, 'terminated'), 'jms_job_queue.job_state_change');
$this->dispatcher->expects($this->at(1))
->method('dispatch')
->with(new StateChangeEvent($b, 'canceled'), 'jms_job_queue.job_state_change');
->withConsecutive(
[new StateChangeEvent($a, 'terminated'), 'jms_job_queue.job_state_change'],
[new StateChangeEvent($b, 'canceled'), 'jms_job_queue.job_state_change'],
);

$this->assertEquals('running', $a->getState());
$this->assertEquals('pending', $b->getState());
Expand All @@ -197,13 +197,12 @@ public function testCloseJobDoesNotCreateRetryJobsWhenCanceled()
$this->em->persist($b);
$this->em->flush();

$this->dispatcher->expects($this->at(0))
->method('dispatch')
->with(new StateChangeEvent($a, 'canceled'), 'jms_job_queue.job_state_change');

$this->dispatcher->expects($this->at(1))
$this->dispatcher->expects(self::exactly(2))
->method('dispatch')
->with(new StateChangeEvent($b, 'canceled'), 'jms_job_queue.job_state_change');
->withConsecutive(
[new StateChangeEvent($a, 'canceled'), 'jms_job_queue.job_state_change'],
[new StateChangeEvent($b, 'canceled'), 'jms_job_queue.job_state_change'],
);

$this->jobManager->closeJob($a, 'canceled');
$this->assertEquals('canceled', $a->getState());
Expand All @@ -220,15 +219,13 @@ public function testCloseJobDoesNotCreateMoreThanAllowedRetries()
$this->em->persist($a);
$this->em->flush();

$this->dispatcher->expects($this->at(0))
->method('dispatch')
->with(new StateChangeEvent($a, 'failed'), 'jms_job_queue.job_state_change');
$this->dispatcher->expects($this->at(1))
->method('dispatch')
->with(new LogicalNot($this->equalTo(new StateChangeEvent($a, 'failed'))), 'jms_job_queue.job_state_change');
$this->dispatcher->expects($this->at(2))
$this->dispatcher->expects(self::exactly(3))
->method('dispatch')
->with(new LogicalNot($this->equalTo(new StateChangeEvent($a, 'failed'))), 'jms_job_queue.job_state_change');
->withConsecutive(
[new StateChangeEvent($a, 'failed'), 'jms_job_queue.job_state_change'],
[new LogicalNot($this->equalTo(new StateChangeEvent($a, 'failed'))), 'jms_job_queue.job_state_change'],
[new LogicalNot($this->equalTo(new StateChangeEvent($a, 'failed'))), 'jms_job_queue.job_state_change'],
);

$this->assertCount(0, $a->getRetryJobs());
$this->jobManager->closeJob($a, 'failed');
Expand Down

0 comments on commit 7792fed

Please sign in to comment.