Completed
Pull Request — master (#2)
by Matthew
19:31 queued 04:20
created

ProductWishListControllerExtensionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
dl 0
loc 30
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testView() 0 11 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 $extraDataObjects = [
25
        TestWishListPage::class,
26
        TestProductWishList::class,
27
    ];
28
29
    /**
30
     *
31
     */
32
    public function testView()
33
    {
34
        $wishList = $this->objFromFixture(TestProductWishList::class, 'one');
35
        /** @var TestWishListPage $wishListPage */
36
        $wishListPage = $this->objFromFixture(TestWishListPage::class, 'one');
37
        $response = $this->get(Controller::join_links(
38
            $wishListPage->Link(),
39
            'view',
40
            $wishList->ID
41
        ));
42
        $this->assertEquals(200, $response->getStatusCode());
43
    }
44
45
}//*/
46