Completed
Push — 5.3 ( d18aef...16c32d )
by Jeroen
15:04 queued 08:59
created

Tests/unit/Event/AdminListEventTest.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\AdminListBundle\Tests\Event;
4
5
use DateTime;
6
use Kunstmaan\AdminListBundle\Event\AdminListEvent;
7
use PHPUnit\Framework\TestCase;
8
use Symfony\Component\Form\Form;
9
use Symfony\Component\HttpFoundation\Request;
10
use Symfony\Component\HttpFoundation\Response;
11
12
/**
13
 * Class AdminListEventTest
14
 */
15
class AdminListEventTest extends TestCase
16
{
17
    public function testGetSet()
18
    {
19
        $date = new DateTime();
20
        $request = new Request();
21
        $form = $this->createMock(Form::class);
22
23
        $event = new AdminListEvent($date, $request, $form);
24
25
        $this->assertInstanceOf(Form::class, $event->getForm());
26
        $this->assertInstanceOf(DateTime::class, $event->getEntity());
27
        $this->assertInstanceOf(Request::class, $event->getRequest());
28
29
        $event->setResponse(new Response());
30
31
        $this->assertInstanceOf(Response::class, $event->getResponse());
32
        $this->assertTrue($event->isPropagationStopped());
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\EventD...:isPropagationStopped() has been deprecated with message: since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
33
    }
34
}
35