Issues (6)

tests/unit/DataObjectExtensionTest.php (1 issue)

1
<?php
2
3
4
namespace Firesphere\SolrPermissions\Tests;
5
6
use Firesphere\SolrPermissions\Extensions\DataObjectExtension;
7
use SilverStripe\Dev\SapphireTest;
8
9
class DataObjectExtensionTest extends SapphireTest
10
{
11
    public function testGetMemberView()
12
    {
13
        $page = \Page::get()->first();
0 ignored issues
show
The type Page was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
        $extension = new DataObjectExtension();
15
        $extension->setOwner($page);
16
17
        $viewStatus = $extension->getMemberView();
18
19
        $this->assertEquals(['null'], $viewStatus);
20
21
        $page->CanViewType = 'LoggedInUsers';
22
        $page->write();
23
24
        $extension->setOwner($page);
25
26
        $status = $extension->getMemberView();
27
28
        $this->assertNotContains('null', $status);
29
    }
30
}
31