Completed
Push — master ( 6c5077...d22a37 )
by Christian
01:33
created

SitemapXMLActionTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.7998
c 0
b 0
f 0
cc 1
nc 1
nop 0
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
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
        $this->assertSame('text/xml', $response->headers->get('Content-Type'));
30
        $this->assertSame('<xml></xml>', $response->getContent());
31
    }
32
}
33