CamelCase and more tests.
This commit is contained in:
@@ -2,12 +2,32 @@
|
||||
|
||||
namespace Frs\Tests;
|
||||
|
||||
use \Frs\FieldDefinition;
|
||||
#use \PHPUnit\Framework\TestCase;
|
||||
|
||||
class FieldDefinitionTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testTrue()
|
||||
public function testLoading()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
$fdo = new FieldDefinition('hotel');
|
||||
$fd = $fdo->getFieldData();
|
||||
$this->assertArraySubset(array('groups'=>array(), 'fields'=>array()), $fd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Exception
|
||||
* @expectedExceptionMessage File definitions/doesnotexist.json not found!
|
||||
*/
|
||||
public function testLoadingFailure()
|
||||
{
|
||||
$fdo = new FieldDefinition('doesnotexist');
|
||||
}
|
||||
|
||||
public function testGroups()
|
||||
{
|
||||
$fdo = new FieldDefinition('hotel');
|
||||
$byGroup = $fdo->getGroups();
|
||||
$this->assertArrayHasKey('Hotel Information', $byGroup);
|
||||
$this->assertArrayHasKey('Metadata', $byGroup);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user