ProductWishListControllerExtensionTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 15
c 1
b 0
f 0
dl 0
loc 42
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 5 1
A testView() 0 13 1
1
<?php
2
3
namespace Dynamic\Wishlist\Test\Extensions;
4
5
use Dynamic\Wishlist\Test\Extra\TestProductWishList;
6
use Dynamic\Wishlist\Test\Extra\TestWishListPage;
7
use SilverStripe\Control\Controller;
8
use SilverStripe\Dev\FunctionalTest;
9
10
/**
11
 * Class ProductWishListControllerExtensionTest
12
 */
13
class ProductWishListControllerExtensionTest extends FunctionalTest
14
{
15
16
    /**
17
     * @var string
18
     */
19
    protected static $fixture_file = '../fixtures.yml';
20
21
    /**
22
     * @var array
23
     */
24
    protected static $extra_dataobjects = [
25
        TestWishListPage::class,
26
        TestProductWishList::class,
27
    ];
28
29
    /**
30
     *
31
     */
32
    public function setUp()
33
    {
34
        parent::setUp();
35
        $this->session()->set('readingMode', 'Stage.Stage');
36
        $this->session()->set('unsecuredDraftSite', true);
37
    }
38
39
    /**
40
     *
41
     */
42
    public function testView()
43
    {
44
        /** @var TestProductWishList $wishList */
45
        $wishList = $this->objFromFixture(TestProductWishList::class, 'one');
46
        /** @var TestWishListPage $wishListPage */
47
        $wishListPage = $this->objFromFixture(TestWishListPage::class, 'one');
48
49
        $response = $this->get(Controller::join_links(
50
            $wishListPage->Link(),
51
            'view',
52
            $wishList->URLSegment
0 ignored issues
show
Bug Best Practice introduced by
The property URLSegment does not exist on Dynamic\Wishlist\Test\Extra\TestProductWishList. Since you implemented __get, consider adding a @property annotation.
Loading history...
53
        ));
54
        $this->assertEquals(200, $response->getStatusCode());
55
    }
56
57
}//*/
58