aboutsummaryrefslogtreecommitdiff
path: root/tests/Formats/AtomFormatTest.php
blob: 77bb9cbc9a8eb11ca0eeb29470f3b8324d553881 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

/**
 * AtomFormat - RFC 4287: The Atom Syndication Format
 * https://tools.ietf.org/html/rfc4287
 */

namespace RssBridge\Tests\Formats;

require_once __DIR__ . '/BaseFormatTest.php';

use PHPUnit\Framework\TestCase;

class AtomFormatTest extends BaseFormatTest
{
    private const PATH_EXPECTED = self::PATH_SAMPLES . 'expectedAtomFormat/';

    /**
     * @dataProvider sampleProvider
     * @runInSeparateProcess
     */
    public function testOutput(string $name, string $path)
    {
        $data = $this->formatData('Atom', $this->loadSample($path));
        $this->assertNotFalse(simplexml_load_string($data));

        $expected = self::PATH_EXPECTED . $name . '.xml';
        $this->assertXmlStringEqualsXmlFile($expected, $data);
    }
}