mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +00:00
28 lines
724 B
PHP
28 lines
724 B
PHP
<?php
|
|
|
|
class databox_descriptionStructureTest extends PhraseanetPHPUnitAbstract
|
|
{
|
|
public function testToArray()
|
|
{
|
|
$structure = new \databox_descriptionStructure();
|
|
|
|
$array = array('name1' => 'value1', 'name2' => 'value2');
|
|
|
|
$element = $this->provideDataboxFieldMock();
|
|
$element->expects($this->once())
|
|
->method('toArray')
|
|
->will($this->returnValue($array));
|
|
|
|
$structure->add_element($element);
|
|
|
|
$this->assertEquals(array($array), $structure->toArray());
|
|
}
|
|
|
|
private function provideDataboxFieldMock()
|
|
{
|
|
return $this->getMockBuilder('databox_field')
|
|
->disableOriginalConstructor()
|
|
->getMock();
|
|
}
|
|
}
|