| @@ 25-33 (lines=9) @@ | ||
| 22 | /** |
|
| 23 | * |
|
| 24 | */ |
|
| 25 | public function testCanCreate() |
|
| 26 | { |
|
| 27 | $wishList = $this->objFromFixture('TestProductWishList', 'one'); |
|
| 28 | $canAccess = $this->objFromFixture('Member', 'cancreate'); |
|
| 29 | $cantAccess = $this->objFromFixture('Member', 'cantcreate'); |
|
| 30 | ||
| 31 | $this->assertTrue($wishList->canCreate($canAccess)); |
|
| 32 | $this->assertFalse($wishList->canCreate($cantAccess)); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * |
|
| @@ 38-46 (lines=9) @@ | ||
| 35 | /** |
|
| 36 | * |
|
| 37 | */ |
|
| 38 | public function testCanEdit() |
|
| 39 | { |
|
| 40 | $wishList = $this->objFromFixture('TestProductWishList', 'one'); |
|
| 41 | $canAccess = $this->objFromFixture('Member', 'cancreate'); |
|
| 42 | $cantAccess = $this->objFromFixture('Member', 'cantcreate'); |
|
| 43 | ||
| 44 | $this->assertTrue($wishList->canEdit($canAccess)); |
|
| 45 | //$this->assertFalse($wishList->canEdit($cantAccess)); |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * |
|
| @@ 51-59 (lines=9) @@ | ||
| 48 | /** |
|
| 49 | * |
|
| 50 | */ |
|
| 51 | public function testCanDelete() |
|
| 52 | { |
|
| 53 | $wishList = $this->objFromFixture('TestProductWishList', 'one'); |
|
| 54 | $canAccess = $this->objFromFixture('Member', 'cancreate'); |
|
| 55 | $cantAccess = $this->objFromFixture('Member', 'cantcreate'); |
|
| 56 | ||
| 57 | $this->assertTrue($wishList->canDelete($canAccess)); |
|
| 58 | //$this->assertFalse($wishList->canDelete($cantAccess)); |
|
| 59 | } |
|
| 60 | ||
| 61 | /** |
|
| 62 | * |
|
| @@ 64-77 (lines=14) @@ | ||
| 61 | /** |
|
| 62 | * |
|
| 63 | */ |
|
| 64 | public function testCanView() |
|
| 65 | { |
|
| 66 | $wishList = $this->objFromFixture('TestProductWishList', 'one'); |
|
| 67 | $canAccess = $this->objFromFixture('Member', 'cancreate'); |
|
| 68 | $cantAccess = $this->objFromFixture('Member', 'cantcreate'); |
|
| 69 | ||
| 70 | $this->assertTrue($wishList->canView($canAccess)); |
|
| 71 | //todo fix following assertion |
|
| 72 | //$this->assertFalse($wishList->canView($cantAccess)); |
|
| 73 | ||
| 74 | $viewableWishList = $this->objFromFixture('TestProductWishList', 'three'); |
|
| 75 | ||
| 76 | $this->assertTrue($viewableWishList->canView($cantAccess)); |
|
| 77 | } |
|
| 78 | ||
| 79 | /** |
|
| 80 | * |
|