-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
227 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Dynamic\Elements\Tests\Model; | ||
|
||
use Dynamic\Elements\Model\TestimonialCategory; | ||
use SilverStripe\Dev\SapphireTest; | ||
use SilverStripe\Security\Member; | ||
|
||
/** | ||
* Class TestimonialCategoryTest | ||
* @package Dynamic\Elements\Tests\Model | ||
*/ | ||
class TestimonialCategoryTest extends SapphireTest | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected static $fixture_file = '../fixtures.yml'; | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanCreate() | ||
{ | ||
$this->assertTrue(TestimonialCategory::singleton()->canCreate($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertFalse(TestimonialCategory::singleton()->canCreate(Member::singleton())); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanEdit() | ||
{ | ||
$this->assertTrue($this->objFromFixture(TestimonialCategory::class, 'one')->canEdit($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertFalse($this->objFromFixture(TestimonialCategory::class, 'one')->canEdit(Member::singleton())); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanDelete() | ||
{ | ||
$this->assertTrue($this->objFromFixture(TestimonialCategory::class, 'one')->canDelete($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertFalse($this->objFromFixture(TestimonialCategory::class, 'one')->canDelete(Member::singleton())); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanView() | ||
{ | ||
$this->assertTrue($this->objFromFixture(TestimonialCategory::class, 'one')->canView($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertTrue($this->objFromFixture(TestimonialCategory::class, 'one')->canView(Member::singleton())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Dynamic\Elements\Tests\Model; | ||
|
||
use Dynamic\Elements\Model\Testimonial; | ||
use SilverStripe\Dev\SapphireTest; | ||
use SilverStripe\Security\Member; | ||
|
||
/** | ||
* Class TestimonialTest | ||
* @package Dynamic\Elements\Tests\Model | ||
*/ | ||
class TestimonialTest extends SapphireTest | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected static $fixture_file = '../fixtures.yml'; | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanCreate() | ||
{ | ||
$this->assertTrue(Testimonial::singleton()->canCreate($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertFalse(Testimonial::singleton()->canCreate(Member::singleton())); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanEdit() | ||
{ | ||
$this->assertTrue($this->objFromFixture(Testimonial::class, 'one')->canEdit($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertFalse($this->objFromFixture(Testimonial::class, 'one')->canEdit(Member::singleton())); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanDelete() | ||
{ | ||
$this->assertTrue($this->objFromFixture(Testimonial::class, 'one')->canDelete($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertFalse($this->objFromFixture(Testimonial::class, 'one')->canDelete(Member::singleton())); | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public function testCanView() | ||
{ | ||
$this->assertTrue($this->objFromFixture(Testimonial::class, 'one')->canView($this->objFromFixture(Member::class, 'site-owner'))); | ||
$this->assertTrue($this->objFromFixture(Testimonial::class, 'one')->canView(Member::singleton())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters