CamelCase and more tests.

This commit is contained in:
2016-07-09 20:22:55 +02:00
parent ba4ead8bf5
commit 120823e83c
2 changed files with 33 additions and 13 deletions

View File

@@ -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);
}
}