Skip to content

Commit 4e26085

Browse files
committed
Remove Copilot comments and clean up test names
1 parent 3122d24 commit 4e26085

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

tests/Hyde/Feature/Hyde/Framework/Testing/Modules/DataCollections/DataCollectionTest/DataCollectionTest.php

+4-20
Original file line numberDiff line numberDiff line change
@@ -27,44 +27,38 @@ public function test_constructor_creates_new_data_collection_instance()
2727
$this->assertInstanceOf(Collection::class, $class);
2828
}
2929

30-
// test constructor sets key
3130
public function test_constructor_sets_key()
3231
{
3332
$class = new DataCollection('foo');
3433
$this->assertEquals('foo', $class->key);
3534
}
3635

37-
// test key is required
3836
public function test_key_is_required()
3937
{
4038
$this->expectException(\ArgumentCountError::class);
4139
new DataCollection();
4240
}
4341

44-
// test Get Collection method returns the collection instance
4542
public function test_get_collection_method_returns_the_collection_instance()
4643
{
4744
$class = new DataCollection('foo');
4845
$this->assertSame($class, $class->getCollection());
4946
}
5047

51-
// test get collection method sets parse time in ms
5248
public function test_get_collection_method_sets_parse_time_in_ms()
5349
{
5450
$class = new DataCollection('foo');
5551
$class->getCollection();
5652
$this->assertIsFloat($class->parseTimeInMs);
5753
}
5854

59-
// test get markdown files method returns empty array if the specified directory does not exist
6055
public function test_get_markdown_files_method_returns_empty_array_if_the_specified_directory_does_not_exist()
6156
{
6257
$class = new DataCollection('foo');
6358
$this->assertIsArray($class->getMarkdownFiles());
6459
$this->assertEmpty($class->getMarkdownFiles());
6560
}
6661

67-
// test get markdown files method returns empty array if no files are found in specified directory
6862
public function test_get_markdown_files_method_returns_empty_array_if_no_files_are_found_in_specified_directory()
6963
{
7064
mkdir(Hyde::path('_data/foo'));
@@ -74,7 +68,6 @@ public function test_get_markdown_files_method_returns_empty_array_if_no_files_a
7468
rmdir(Hyde::path('_data/foo'));
7569
}
7670

77-
// test get markdown files method returns an array of markdown files in the specified directory
7871
public function test_get_markdown_files_method_returns_an_array_of_markdown_files_in_the_specified_directory()
7972
{
8073
mkdir(Hyde::path('_data/foo'));
@@ -89,7 +82,6 @@ public function test_get_markdown_files_method_returns_an_array_of_markdown_file
8982
File::deleteDirectory(Hyde::path('_data/foo'));
9083
}
9184

92-
// test get markdown files method does not include files in subdirectories
9385
public function test_get_markdown_files_method_does_not_include_files_in_subdirectories()
9486
{
9587
mkdir(Hyde::path('_data/foo'));
@@ -102,7 +94,6 @@ public function test_get_markdown_files_method_does_not_include_files_in_subdire
10294
File::deleteDirectory(Hyde::path('_data/foo'));
10395
}
10496

105-
// test get markdown files method does not include files with extensions other than .md
10697
public function test_get_markdown_files_method_does_not_include_files_with_extensions_other_than_md()
10798
{
10899
mkdir(Hyde::path('_data/foo'));
@@ -114,13 +105,11 @@ public function test_get_markdown_files_method_does_not_include_files_with_exten
114105
File::deleteDirectory(Hyde::path('_data/foo'));
115106
}
116107

117-
// test static markdown helper returns new data collection instance
118108
public function test_static_markdown_helper_returns_new_data_collection_instance()
119109
{
120110
$this->assertInstanceOf(DataCollection::class, DataCollection::markdown('foo'));
121111
}
122112

123-
// test static markdown helper discovers and parses markdown files in the specified directory
124113
public function test_static_markdown_helper_discovers_and_parses_markdown_files_in_the_specified_directory()
125114
{
126115
mkdir(Hyde::path('_data/foo'));
@@ -134,7 +123,6 @@ public function test_static_markdown_helper_discovers_and_parses_markdown_files_
134123
File::deleteDirectory(Hyde::path('_data/foo'));
135124
}
136125

137-
// test static markdown helper ignores files starting with an underscore
138126
public function test_static_markdown_helper_ignores_files_starting_with_an_underscore()
139127
{
140128
mkdir(Hyde::path('_data/foo'));
@@ -144,7 +132,6 @@ public function test_static_markdown_helper_ignores_files_starting_with_an_under
144132
File::deleteDirectory(Hyde::path('_data/foo'));
145133
}
146134

147-
// test markdown facade returns same result as static markdown helper
148135
public function test_markdown_facade_returns_same_result_as_static_markdown_helper()
149136
{
150137
$expected = DataCollection::markdown('foo');
@@ -155,14 +142,13 @@ public function test_markdown_facade_returns_same_result_as_static_markdown_help
155142
}
156143

157144
// 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()
159146
{
160147
$this->assertArrayHasKey('MarkdownCollection', AliasLoader::getInstance()->getAliases());
161148
$this->assertContains(MarkdownCollection::class, AliasLoader::getInstance()->getAliases());
162149
}
163150

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()
166152
{
167153
File::deleteDirectory(Hyde::path('_data'));
168154
$this->assertFileDoesNotExist(Hyde::path('_data'));
@@ -172,14 +158,12 @@ public function test_DataCollectionServiceProvider_creates_the__data_directory_i
172158
$this->assertFileExists(Hyde::path('_data'));
173159
}
174160

175-
// test class has static source directory property
176-
public function testClassHasStaticSourceDirectoryProperty()
161+
public function test_class_has_static_source_directory_property()
177162
{
178163
$this->assertEquals('_data', DataCollection::$sourceDirectory);
179164
}
180165

181-
// test source directory can be changed
182-
public function testSourceDirectoryCanBeChanged()
166+
public function test_source_directory_can_be_changed()
183167
{
184168
DataCollection::$sourceDirectory = 'foo';
185169
mkdir(Hyde::path('foo/bar'), recursive: true);

0 commit comments

Comments
 (0)