This repository was archived by the owner on Dec 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTestDataFactory.php
More file actions
96 lines (87 loc) · 2.21 KB
/
Copy pathTestDataFactory.php
File metadata and controls
96 lines (87 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
final class TestDataFactory extends ThemeViz\TestCase {
/** @var \ThemeViz\DataFactory $dataFactory */
private $dataFactory;
private $themeConfWithCollection = [
"depends" => [
"collections" => [
"myCarousel" => [
"name" => "My Carousel",
"singular_name" => "Carousel Item",
"fields" => [
"image" => [
"name" => "Image",
"type" => "image",
"required" => true,
"image_min_size" => "1500 x 425"
],
"caption" => [
"name" => "Slide Caption",
"type" => "text"
],
"description" => [
"name" => "Slide Description",
"type" => "text"
],
"url" => [
"name" => "Link",
"type" => "text"
],
"urlTarget" => [
"name" => "Open Link in New Window",
"type" => "tf"
],
"activationDate" => [
"name" => "Activation Date",
"type" => "date"
],
"deactivationDate" => [
"name" => "Deactivation Date",
"type" => "date"
]
],
"data" => [
[
"image" => "{{ su.misc.privatelabel }}/carousel1.jpg",
"caption" => "Slide One",
"description" => "Description for slide one. Edit in theme customizer."
],
[
"image" => "{{ su.misc.privatelabel }}/carousel2.jpg",
"caption" => "Slide Two",
"description" => "Description for slide two. Edit in theme customizer."
],
[
"image" => "{{ su.misc.privatelabel }}/carousel3.jpg",
"caption" => "Slide Three",
"description" => "Description for slide three. Edit in theme customizer."
]
]
]
]
]
];
protected function setUp()
{
parent::setUp();
$this->dataFactory = $this->factory->get("DataFactory");
}
// public function testLoadsCollectionData()
// {
// $this->loadMinimalComponentsFile();
//
// $this->mockFilesystem->loadThemeConf($this->themeConfWithCollection);
//
// $data = $this->dataFactory->makeData([]);
//
// $result = $data->su()->collection('myCarousel')->find();
//
// $this->assertCount(3, $result);
// }
public function testReturnsArray()
{
$this->loadMinimalComponentsFile();
$data = $this->dataFactory->makeData([]);
$this->assertTrue(is_array($data));
}
}