Skip to content

Commit

Permalink
Fixed some issues with deprecated code, added a listener that will no…
Browse files Browse the repository at this point in the history
…t spit out deprecation notices while tests are running because it was causing an issue with CI
  • Loading branch information
chartjes committed Apr 7, 2019
1 parent 405b9d8 commit 359db99
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ infection: vendor database
php -d zend_extension=xdebug.so vendor/bin/infection

integration: test-env vendor database cache
vendor/bin/phpunit --testsuite integration
SYMFONY_DEPRECATIONS_HELPER=disabled vendor/bin/phpunit --testsuite integration

stan: vendor
vendor/bin/phpstan analyse
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@
<directory>tests/Integration</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
</phpunit>
7 changes: 4 additions & 3 deletions src/Domain/Services/ResetEmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace OpenCFP\Domain\Services;

use OpenCFP\Infrastructure\Templating\Template;
use Twig\Environment;

class ResetEmailer
{
Expand All @@ -23,7 +24,7 @@ class ResetEmailer
private $swiftMailer;

/**
* @var \Twig_Environment
* @var \Twig\Environment
*/
private $twig;

Expand All @@ -39,11 +40,11 @@ class ResetEmailer

/**
* @param \Swift_Mailer $swiftMailer
* @param \Twig_Environment $twig
* @param Environment $twig
* @param string $configEmail
* @param string $configTitle
*/
public function __construct(\Swift_Mailer $swiftMailer, \Twig_Environment $twig, string $configEmail, string $configTitle)
public function __construct(\Swift_Mailer $swiftMailer, Environment $twig, string $configEmail, string $configTitle)
{
$this->swiftMailer = $swiftMailer;
$this->twig = $twig;
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Action/Talk/CreateProcessAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use Swift_Message;
use Symfony\Component\HttpFoundation;
use Symfony\Component\Routing;
use Twig_Environment;
use Twig\Environment;

final class CreateProcessAction
{
Expand Down Expand Up @@ -69,7 +69,7 @@ final class CreateProcessAction
private $applicationEndDate;

/**
* @var Twig_Environment
* @var Environment
*/
private $twig;

Expand All @@ -87,7 +87,7 @@ public function __construct(
string $applicationEmail,
string $applicationTitle,
string $applicationEndDate,
Twig_Environment $twig,
Environment $twig,
Routing\Generator\UrlGeneratorInterface $urlGenerator
) {
$this->authentication = $authentication;
Expand Down
2 changes: 1 addition & 1 deletion src/Infrastructure/Templating/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace OpenCFP\Infrastructure\Templating;

abstract class Template extends \Twig_Template
abstract class Template extends \Twig\Template
{
/**
* Renders a block, including global context variables, so it can be used directly
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Domain/Services/ResetEmailerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use OpenCFP\Domain\Services\ResetEmailer;
use Swift_Mailer;
use Swift_Message;
use Twig_Template;
use Twig\Template;

final class ResetEmailerTest extends \PHPUnit\Framework\TestCase
{
Expand All @@ -40,10 +40,10 @@ public function it_sends_the_expected_email()
}))
->getMock();

/* @var Twig_Template $template */
$template = Mockery::mock(Twig_Template::class)->shouldIgnoreMissing();
/* @var Twig\Template $template */
$template = Mockery::mock(Twig\Template::class)->shouldIgnoreMissing();

$twig = Mockery::mock(\Twig_Environment::class);
$twig = Mockery::mock(\Twig\Environment::class);
$twig->shouldReceive('loadTemplate')
->withArgs(['emails/reset_password.twig'])
->andReturn($template);
Expand Down

0 comments on commit 359db99

Please sign in to comment.