Archived
1
0
This repository has been archived on 2025-03-31. You can view files and clone it, but cannot push or open issues or pull requests.
php-frs/tests/FieldDefinitionTest.php

34 lines
856 B
PHP

<?php
namespace Frs\Tests;
use \Frs\FieldDefinition;
#use \PHPUnit\Framework\TestCase;
class FieldDefinitionTest extends \PHPUnit_Framework_TestCase
{
public function testLoading()
{
$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);
}
}