| @@ 167-178 (lines=12) @@ | ||
| 164 | $this->assertSame(array(), $validator->getMessage()); |
|
| 165 | } |
|
| 166 | ||
| 167 | public function providerForValidateOK() |
|
| 168 | { |
|
| 169 | return array( |
|
| 170 | array(10), |
|
| 171 | array(11), |
|
| 172 | array(12), |
|
| 173 | array(12.5), |
|
| 174 | array(13), |
|
| 175 | array(14), |
|
| 176 | array(15), |
|
| 177 | ); |
|
| 178 | } |
|
| 179 | ||
| 180 | /** |
|
| 181 | * Tests validating a wrong value. |
|
| @@ 22-62 (lines=41) @@ | ||
| 19 | */ |
|
| 20 | class RichTextStorageTest extends PHPUnit_Framework_TestCase |
|
| 21 | { |
|
| 22 | public function providerForTestGetFieldData() |
|
| 23 | { |
|
| 24 | return array( |
|
| 25 | array( |
|
| 26 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 27 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 28 | <para> |
|
| 29 | <link xlink:href="ezurl://123#fragment1">Existing external link</link> |
|
| 30 | </para> |
|
| 31 | <para> |
|
| 32 | <link xlink:href="ezurl://456#fragment2">Non-existing external link</link> |
|
| 33 | </para> |
|
| 34 | </section>', |
|
| 35 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 36 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 37 | <para> |
|
| 38 | <link xlink:href="http://www.ez.no#fragment1">Existing external link</link> |
|
| 39 | </para> |
|
| 40 | <para> |
|
| 41 | <link xlink:href="#">Non-existing external link</link> |
|
| 42 | </para> |
|
| 43 | </section> |
|
| 44 | ', |
|
| 45 | array(123, 456), |
|
| 46 | array(123 => 'http://www.ez.no'), |
|
| 47 | ), |
|
| 48 | array( |
|
| 49 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 50 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 51 | <para>Oh links, where art thou?</para> |
|
| 52 | </section>', |
|
| 53 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 54 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 55 | <para>Oh links, where art thou?</para> |
|
| 56 | </section> |
|
| 57 | ', |
|
| 58 | array(), |
|
| 59 | array(), |
|
| 60 | ), |
|
| 61 | ); |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * @dataProvider providerForTestGetFieldData |
|
| @@ 19-63 (lines=45) @@ | ||
| 16 | ||
| 17 | class DocbookTest extends PHPUnit_Framework_TestCase |
|
| 18 | { |
|
| 19 | public function providerForTestValidate() |
|
| 20 | { |
|
| 21 | return array( |
|
| 22 | array( |
|
| 23 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 24 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 25 | <para> |
|
| 26 | <link xlink:href="ezurl://72">Hello <link xlink:href="ezurl://27">goodbye</link></link> |
|
| 27 | </para> |
|
| 28 | </section> |
|
| 29 | ', |
|
| 30 | array( |
|
| 31 | 'link must not occur in the descendants of link', |
|
| 32 | ), |
|
| 33 | ), |
|
| 34 | array( |
|
| 35 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 36 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 37 | <para>Some <link xlink:href="ezcontent://601">linked <ezembedinline xlink:href="ezcontent://601"> |
|
| 38 | <ezlink xlink:href="ezcontent://106"/> |
|
| 39 | </ezembedinline> linked</link> embeds.</para> |
|
| 40 | </section> |
|
| 41 | ', |
|
| 42 | array( |
|
| 43 | 'ezlink must not occur in the descendants of link', |
|
| 44 | ), |
|
| 45 | ), |
|
| 46 | array( |
|
| 47 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 48 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 49 | <para ezxhtml:class="listening loud indie rock">Nada Surf - Happy Kid</para> |
|
| 50 | </section> |
|
| 51 | ', |
|
| 52 | array(), |
|
| 53 | ), |
|
| 54 | array( |
|
| 55 | '<?xml version="1.0" encoding="UTF-8"?> |
|
| 56 | <section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ezxhtml="http://ez.no/xmlns/ezpublish/docbook/xhtml" xmlns:ezcustom="http://ez.no/xmlns/ezpublish/docbook/custom" version="5.0-variant ezpublish-1.0"> |
|
| 57 | <para ezxhtml:class="">Nada Surf - Happy Kid</para> |
|
| 58 | </section> |
|
| 59 | ', |
|
| 60 | array(), |
|
| 61 | ), |
|
| 62 | ); |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * @dataProvider providerForTestValidate |
|
| @@ 76-83 (lines=8) @@ | ||
| 73 | $this->purgeClient->purge($locationIds); |
|
| 74 | } |
|
| 75 | ||
| 76 | public function purgeTestProvider() |
|
| 77 | { |
|
| 78 | return array( |
|
| 79 | array(array(123)), |
|
| 80 | array(array(123, 456)), |
|
| 81 | array(array(123, 456, 789)), |
|
| 82 | ); |
|
| 83 | } |
|
| 84 | ||
| 85 | public function testPurgeAll() |
|
| 86 | { |
|
| @@ 34-46 (lines=13) @@ | ||
| 31 | ]; |
|
| 32 | } |
|
| 33 | ||
| 34 | public static function restRequestUrisProvider() |
|
| 35 | { |
|
| 36 | return [ |
|
| 37 | ['/api/ezp/v2/true'], |
|
| 38 | ['/api/bundle-name/v2/true'], |
|
| 39 | ['/api/MyBundle12/v2/true'], |
|
| 40 | ['/api/ThisIs_Bundle123/v2/true'], |
|
| 41 | ['/api/my-bundle/v1/true'], |
|
| 42 | ['/api/my-bundle/v2/true'], |
|
| 43 | ['/api/my-bundle/v2.7/true'], |
|
| 44 | ['/api/my-bundle/v122.73/true'], |
|
| 45 | ]; |
|
| 46 | } |
|
| 47 | ||
| 48 | public static function nonRestRequestsUrisProvider() |
|
| 49 | { |
|
| @@ 48-60 (lines=13) @@ | ||
| 45 | ]; |
|
| 46 | } |
|
| 47 | ||
| 48 | public static function nonRestRequestsUrisProvider() |
|
| 49 | { |
|
| 50 | return [ |
|
| 51 | ['/ap/ezp/v2/false'], |
|
| 52 | ['/api/bundle name/v2/false'], |
|
| 53 | ['/api/My/Bundle/v2/false'], |
|
| 54 | ['/api//v2/false'], |
|
| 55 | ['/api/my-bundle/v/false'], |
|
| 56 | ['/api/my-bundle/v2-2/false'], |
|
| 57 | ['/api/my-bundle/v2 7/false'], |
|
| 58 | ['/api/my-bundle/v/7/false'], |
|
| 59 | ]; |
|
| 60 | } |
|
| 61 | ||
| 62 | public function testOnKernelRequestNotMasterRequest() |
|
| 63 | { |
|