SitemapXMLActionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testExecute() 0 14 1
1
<?php
2
3
/*
4
 * (c) Christian Gripp <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Core23\SitemapBundle\Tests\Action;
11
12
use Core23\SitemapBundle\Action\SitemapXMLAction;
13
use Core23\SitemapBundle\Generator\SitemapGeneratorInterface;
14
use PHPUnit\Framework\TestCase;
15
16
final class SitemapXMLActionTest extends TestCase
17
{
18
    public function testExecute(): void
19
    {
20
        $generator = $this->prophesize(SitemapGeneratorInterface::class);
21
        $generator->toXML()
22
            ->willReturn('<xml></xml>')
23
        ;
24
25
        $action = new SitemapXMLAction($generator->reveal());
26
27
        $response = $action();
28
29
        static::assertSame('text/xml', $response->headers->get('Content-Type'));
30
        static::assertSame('<xml></xml>', $response->getContent());
31
    }
32
}
33