1 | <?php |
||
7 | class ContentMapperTest extends PHPUnit_Framework_TestCase |
||
|
|||
8 | { |
||
9 | /** |
||
10 | * If the given content data is valid a Content model with the given content data should be |
||
11 | * returned |
||
12 | * |
||
13 | * @test |
||
14 | * @dataProvider getValidContentData |
||
15 | * |
||
16 | * @param array $contentData Product content data |
||
17 | */ |
||
18 | public function getContent_ValidContentDataGiven_ContentWithSummaryAndDescriptionIsReturned($contentData) |
||
31 | |||
32 | /** |
||
33 | * If the given content data is valid a Content model with the given content data should be |
||
34 | * returned |
||
35 | * |
||
36 | * @test |
||
37 | * @dataProvider getContentDataWithMissingAttributes |
||
38 | * @expectedException Wambo\Catalog\Error\ContentException |
||
39 | * @expectedExceptionMessageRegExp /The field '.+' is missing in the given content data/ |
||
40 | * |
||
41 | * @param array $contentData Product content data |
||
42 | */ |
||
43 | public function getContent_FieldsMissing_ContentExceptionIsThrown($contentData) |
||
51 | |||
52 | /** |
||
53 | * If some of the given attributes are invalid a ContentException should be thrown |
||
54 | * |
||
55 | * @test |
||
56 | * @dataProvider getContentWithInvalidAttributes |
||
57 | * @expectedException Wambo\Catalog\Error\ContentException |
||
58 | * @expectedExceptionMessageRegExp /Failed to create a content model from the given data/ |
||
59 | * |
||
60 | * @param array $contentData Product content data |
||
61 | */ |
||
62 | public function getContent_InvalidAttributes_ContentExceptionIsThrown($contentData) |
||
70 | |||
71 | /** |
||
72 | * Get a list of valid content data for testing |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | public static function getValidContentData() |
||
94 | |||
95 | /** |
||
96 | * Get a list of content data with invalid attributes for testing |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | public static function getContentWithInvalidAttributes() |
||
133 | |||
134 | /** |
||
135 | * Get a list of content data object with missing attributes for testing |
||
136 | * |
||
137 | * @return array |
||
138 | */ |
||
139 | public static function getContentDataWithMissingAttributes() |
||
171 | } |
||
172 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.