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\NodeBundle\Tests\Event; |
||
4 | |||
5 | use Kunstmaan\VotingBundle\Event\LinkedIn\LinkedInShareEvent; |
||
6 | use PHPUnit\Framework\TestCase; |
||
7 | use Symfony\Component\HttpFoundation\Request; |
||
8 | use Symfony\Component\HttpFoundation\Response; |
||
9 | |||
10 | /** |
||
11 | * Class LinkedInShareEventTest |
||
12 | */ |
||
13 | View Code Duplication | class LinkedInShareEventTest extends TestCase |
|
0 ignored issues
–
show
|
|||
14 | { |
||
15 | public function testGetSet() |
||
16 | { |
||
17 | $request = new Request(); |
||
18 | $response = new Response(); |
||
19 | |||
20 | $event = new LinkedInShareEvent($request, $response, 100); |
||
21 | |||
22 | $this->assertInstanceOf(Request::class, $event->getRequest()); |
||
23 | $this->assertInstanceOf(Response::class, $event->getReference()); |
||
24 | $this->assertEquals(100, $event->getValue()); |
||
25 | } |
||
26 | } |
||
27 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.