@@ -27,44 +27,38 @@ public function test_constructor_creates_new_data_collection_instance()
27
27
$ this ->assertInstanceOf (Collection::class, $ class );
28
28
}
29
29
30
- // test constructor sets key
31
30
public function test_constructor_sets_key ()
32
31
{
33
32
$ class = new DataCollection ('foo ' );
34
33
$ this ->assertEquals ('foo ' , $ class ->key );
35
34
}
36
35
37
- // test key is required
38
36
public function test_key_is_required ()
39
37
{
40
38
$ this ->expectException (\ArgumentCountError::class);
41
39
new DataCollection ();
42
40
}
43
41
44
- // test Get Collection method returns the collection instance
45
42
public function test_get_collection_method_returns_the_collection_instance ()
46
43
{
47
44
$ class = new DataCollection ('foo ' );
48
45
$ this ->assertSame ($ class , $ class ->getCollection ());
49
46
}
50
47
51
- // test get collection method sets parse time in ms
52
48
public function test_get_collection_method_sets_parse_time_in_ms ()
53
49
{
54
50
$ class = new DataCollection ('foo ' );
55
51
$ class ->getCollection ();
56
52
$ this ->assertIsFloat ($ class ->parseTimeInMs );
57
53
}
58
54
59
- // test get markdown files method returns empty array if the specified directory does not exist
60
55
public function test_get_markdown_files_method_returns_empty_array_if_the_specified_directory_does_not_exist ()
61
56
{
62
57
$ class = new DataCollection ('foo ' );
63
58
$ this ->assertIsArray ($ class ->getMarkdownFiles ());
64
59
$ this ->assertEmpty ($ class ->getMarkdownFiles ());
65
60
}
66
61
67
- // test get markdown files method returns empty array if no files are found in specified directory
68
62
public function test_get_markdown_files_method_returns_empty_array_if_no_files_are_found_in_specified_directory ()
69
63
{
70
64
mkdir (Hyde::path ('_data/foo ' ));
@@ -74,7 +68,6 @@ public function test_get_markdown_files_method_returns_empty_array_if_no_files_a
74
68
rmdir (Hyde::path ('_data/foo ' ));
75
69
}
76
70
77
- // test get markdown files method returns an array of markdown files in the specified directory
78
71
public function test_get_markdown_files_method_returns_an_array_of_markdown_files_in_the_specified_directory ()
79
72
{
80
73
mkdir (Hyde::path ('_data/foo ' ));
@@ -89,7 +82,6 @@ public function test_get_markdown_files_method_returns_an_array_of_markdown_file
89
82
File::deleteDirectory (Hyde::path ('_data/foo ' ));
90
83
}
91
84
92
- // test get markdown files method does not include files in subdirectories
93
85
public function test_get_markdown_files_method_does_not_include_files_in_subdirectories ()
94
86
{
95
87
mkdir (Hyde::path ('_data/foo ' ));
@@ -102,7 +94,6 @@ public function test_get_markdown_files_method_does_not_include_files_in_subdire
102
94
File::deleteDirectory (Hyde::path ('_data/foo ' ));
103
95
}
104
96
105
- // test get markdown files method does not include files with extensions other than .md
106
97
public function test_get_markdown_files_method_does_not_include_files_with_extensions_other_than_md ()
107
98
{
108
99
mkdir (Hyde::path ('_data/foo ' ));
@@ -114,13 +105,11 @@ public function test_get_markdown_files_method_does_not_include_files_with_exten
114
105
File::deleteDirectory (Hyde::path ('_data/foo ' ));
115
106
}
116
107
117
- // test static markdown helper returns new data collection instance
118
108
public function test_static_markdown_helper_returns_new_data_collection_instance ()
119
109
{
120
110
$ this ->assertInstanceOf (DataCollection::class, DataCollection::markdown ('foo ' ));
121
111
}
122
112
123
- // test static markdown helper discovers and parses markdown files in the specified directory
124
113
public function test_static_markdown_helper_discovers_and_parses_markdown_files_in_the_specified_directory ()
125
114
{
126
115
mkdir (Hyde::path ('_data/foo ' ));
@@ -134,7 +123,6 @@ public function test_static_markdown_helper_discovers_and_parses_markdown_files_
134
123
File::deleteDirectory (Hyde::path ('_data/foo ' ));
135
124
}
136
125
137
- // test static markdown helper ignores files starting with an underscore
138
126
public function test_static_markdown_helper_ignores_files_starting_with_an_underscore ()
139
127
{
140
128
mkdir (Hyde::path ('_data/foo ' ));
@@ -144,7 +132,6 @@ public function test_static_markdown_helper_ignores_files_starting_with_an_under
144
132
File::deleteDirectory (Hyde::path ('_data/foo ' ));
145
133
}
146
134
147
- // test markdown facade returns same result as static markdown helper
148
135
public function test_markdown_facade_returns_same_result_as_static_markdown_helper ()
149
136
{
150
137
$ expected = DataCollection::markdown ('foo ' );
@@ -155,14 +142,13 @@ public function test_markdown_facade_returns_same_result_as_static_markdown_help
155
142
}
156
143
157
144
// Test DataCollectionServiceProvider registers the facade as an alias
158
- public function test_DataCollectionServiceProvider_registers_the_facade_as_an_alias ()
145
+ public function test_data_collection_service_provider_registers_the_facade_as_an_alias ()
159
146
{
160
147
$ this ->assertArrayHasKey ('MarkdownCollection ' , AliasLoader::getInstance ()->getAliases ());
161
148
$ this ->assertContains (MarkdownCollection::class, AliasLoader::getInstance ()->getAliases ());
162
149
}
163
150
164
- // test DataCollectionServiceProvider creates the _data directory if it does not exist
165
- public function test_DataCollectionServiceProvider_creates_the__data_directory_if_it_does_not_exist ()
151
+ public function test_data_collection_service_provider_creates_the__data_directory_if_it_does_not_exist ()
166
152
{
167
153
File::deleteDirectory (Hyde::path ('_data ' ));
168
154
$ this ->assertFileDoesNotExist (Hyde::path ('_data ' ));
@@ -172,14 +158,12 @@ public function test_DataCollectionServiceProvider_creates_the__data_directory_i
172
158
$ this ->assertFileExists (Hyde::path ('_data ' ));
173
159
}
174
160
175
- // test class has static source directory property
176
- public function testClassHasStaticSourceDirectoryProperty ()
161
+ public function test_class_has_static_source_directory_property ()
177
162
{
178
163
$ this ->assertEquals ('_data ' , DataCollection::$ sourceDirectory );
179
164
}
180
165
181
- // test source directory can be changed
182
- public function testSourceDirectoryCanBeChanged ()
166
+ public function test_source_directory_can_be_changed ()
183
167
{
184
168
DataCollection::$ sourceDirectory = 'foo ' ;
185
169
mkdir (Hyde::path ('foo/bar ' ), recursive: true );
0 commit comments