Conditions | 3 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
10 | public function testUpdateNotificationRecipients() |
||
11 | { |
||
12 | if (!class_exists('CommentNotifier')) { |
||
13 | $this->markTestSkipped('Comments Notification module is not installed'); |
||
14 | } |
||
15 | |||
16 | $blogPost = $this->objFromFixture('BlogPost', 'PostC'); |
||
17 | $comment = new Comment(); |
||
18 | $comment->Comment = 'This is a comment'; |
||
19 | $comment->write(); |
||
20 | $recipients = $blogPost->notificationRecipients( |
||
21 | $comment |
||
22 | )->toArray(); |
||
23 | |||
24 | $segments = array(); |
||
25 | foreach ($recipients as $recipient) { |
||
26 | array_push($segments, $recipient->URLSegment); |
||
27 | } |
||
28 | |||
29 | sort($segments); |
||
30 | $this->assertEquals(array('blog-contributor', 'blog-editor', |
||
31 | 'blog-writer', ), $segments); |
||
32 | } |
||
33 | |||
53 |
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.