Skip to content

Commit

Permalink
initial tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirish committed Sep 4, 2024
1 parent 330fa21 commit 9568111
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Model/LocationCategoryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Dynamic\Elements\Locations\Test;

use SilverStripe\Forms\FieldList;
use SilverStripe\Dev\SapphireTest;
use Dynamic\Elements\Locations\Model\LocationCategory;

class LocationCategoryTest extends SapphireTest
{
protected static $fixture_file = 'location-category.yml';

public function testGetCMSFields()
{
$object = $this->objFromFixture(LocationCategory::class, 'one');
$fields = $object->getCMSFields();
$this->assertInstanceOf(FieldList::class, $fields);
}
}
19 changes: 19 additions & 0 deletions tests/Model/LocationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Dynamic\Elements\Locations\Test;

use SilverStripe\Forms\FieldList;
use SilverStripe\Dev\SapphireTest;
use Dynamic\Elements\Locations\Model\Location;

class LocationTest extends SapphireTest
{
protected static $fixture_file = 'location.yml';

public function testGetCMSFields()
{
$object = $this->objFromFixture(Location::class, 'one');
$fields = $object->getCMSFields();
$this->assertInstanceOf(FieldList::class, $fields);
}
}
3 changes: 3 additions & 0 deletions tests/Model/location-category.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dynamic\Elements\Locations\Model\LocationCategory:
one:
Title: "Location Category One"
3 changes: 3 additions & 0 deletions tests/Model/location.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Dynamic\Elements\Locations\Model\Location:
one:
Title: "Location One"

0 comments on commit 9568111

Please sign in to comment.