|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace spec\FSi\Bundle\AdminBundle\Factory\Worker; |
|
4
|
|
|
|
|
5
|
|
|
use PhpSpec\ObjectBehavior; |
|
6
|
|
|
|
|
7
|
|
|
class ListWorkerSpec extends ObjectBehavior |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @param \FSi\Component\DataSource\DataSourceFactory $dataSourceFactory |
|
11
|
|
|
* @param \FSi\Component\DataGrid\DataGridFactory $dataGridFactory |
|
12
|
|
|
*/ |
|
13
|
|
|
function let($dataSourceFactory, $dataGridFactory) |
|
14
|
|
|
{ |
|
15
|
|
|
$this->beConstructedWith($dataSourceFactory, $dataGridFactory); |
|
16
|
|
|
} |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @param \FSi\Bundle\AdminBundle\spec\fixtures\Admin\DataGridAwareElement $element |
|
20
|
|
|
* @param \FSi\Component\DataGrid\DataGridFactory $dataGridFactory |
|
21
|
|
|
*/ |
|
22
|
|
|
function it_mount_datagrid_factory_to_elements_that_are_datagrid_aware($element, $dataGridFactory) |
|
23
|
|
|
{ |
|
24
|
|
|
$element->setDataGridFactory($dataGridFactory)->shouldBeCalled(); |
|
25
|
|
|
|
|
26
|
|
|
$this->mount($element); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param \FSi\Bundle\AdminBundle\spec\fixtures\Admin\DataSourceAwareElement $element |
|
31
|
|
|
* @param \FSi\Component\DataSource\DataSourceFactory $dataSourceFactory |
|
32
|
|
|
*/ |
|
33
|
|
|
function it_mount_datagrid_factory_to_elements_that_are_datasource_aware($element, $dataSourceFactory) |
|
34
|
|
|
{ |
|
35
|
|
|
$element->setDataSourceFactory($dataSourceFactory)->shouldBeCalled(); |
|
36
|
|
|
|
|
37
|
|
|
$this->mount($element); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @param \FSi\Bundle\AdminBundle\Admin\CRUD\AbstractCRUD $element |
|
42
|
|
|
* @param \FSi\Component\DataSource\DataSourceFactory $dataSourceFactory |
|
43
|
|
|
* @param \FSi\Component\DataGrid\DataGridFactory $dataGridFactory |
|
44
|
|
|
*/ |
|
45
|
|
|
function it_mount_datasource_factory_and_datagrid_factory_to_elements_that_behave_like_list( |
|
46
|
|
|
$element, $dataSourceFactory, $dataGridFactory |
|
47
|
|
|
) { |
|
48
|
|
|
$element->setDataSourceFactory($dataSourceFactory)->shouldBeCalled(); |
|
49
|
|
|
$element->setDataGridFactory($dataGridFactory)->shouldBeCalled(); |
|
50
|
|
|
|
|
51
|
|
|
$this->mount($element); |
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* @param \FSi\Bundle\AdminBundle\Admin\CRUD\ListElement $element |
|
56
|
|
|
* @param \FSi\Component\DataSource\DataSourceFactory $dataSourceFactory |
|
57
|
|
|
* @param \FSi\Component\DataGrid\DataGridFactory $dataGridFactory |
|
58
|
|
|
*/ |
|
59
|
|
|
function it_mount_datasource_factory_and_datagrid_factory_to_elements_that_implements_list_element( |
|
60
|
|
|
$element, $dataSourceFactory, $dataGridFactory |
|
61
|
|
|
) { |
|
62
|
|
|
$element->setDataSourceFactory($dataSourceFactory)->shouldBeCalled(); |
|
63
|
|
|
$element->setDataGridFactory($dataGridFactory)->shouldBeCalled(); |
|
64
|
|
|
|
|
65
|
|
|
$this->mount($element); |
|
66
|
|
|
} |
|
67
|
|
|
} |
|
68
|
|
|
|