Skip to content

Commit 27598a1

Browse files
author
Nathan Esayeas
authored
Rename draft fixtures (#244)
1 parent ba68613 commit 27598a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+125
-125
lines changed

tests/Feature/BlueprintTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function setUp(): void
3030
*/
3131
public function it_parses_models()
3232
{
33-
$blueprint = $this->fixture('definitions/models-only.bp');
33+
$blueprint = $this->fixture('drafts/models-only.yaml');
3434

3535
$this->assertEquals([
3636
'models' => [
@@ -47,7 +47,7 @@ public function it_parses_models()
4747

4848
public function it_parses_seeders()
4949
{
50-
$blueprint = $this->fixture('definitions/seeders.bp');
50+
$blueprint = $this->fixture('drafts/seeders.yaml');
5151

5252
$this->assertEquals([
5353
'models' => [
@@ -72,7 +72,7 @@ public function it_parses_seeders()
7272
*/
7373
public function it_parses_controllers()
7474
{
75-
$blueprint = $this->fixture('definitions/controllers-only.bp');
75+
$blueprint = $this->fixture('drafts/controllers-only.yaml');
7676

7777
$this->assertEquals([
7878
'controllers' => [
@@ -99,7 +99,7 @@ public function it_parses_controllers()
9999
*/
100100
public function it_parses_shorthands()
101101
{
102-
$blueprint = $this->fixture('definitions/shorthands.bp');
102+
$blueprint = $this->fixture('drafts/shorthands.yaml');
103103

104104
$this->assertEquals([
105105
'models' => [
@@ -122,7 +122,7 @@ public function it_parses_shorthands()
122122
*/
123123
public function it_parses_uuid_shorthand()
124124
{
125-
$blueprint = $this->fixture('definitions/uuid-shorthand.bp');
125+
$blueprint = $this->fixture('drafts/uuid-shorthand.yaml');
126126

127127
$this->assertEquals([
128128
'models' => [
@@ -139,7 +139,7 @@ public function it_parses_uuid_shorthand()
139139
*/
140140
public function it_parses_shorthands_with_timezones()
141141
{
142-
$blueprint = $this->fixture('definitions/with-timezones.bp');
142+
$blueprint = $this->fixture('drafts/with-timezones.yaml');
143143

144144
$this->assertEquals([
145145
'models' => [
@@ -156,7 +156,7 @@ public function it_parses_shorthands_with_timezones()
156156
*/
157157
public function it_parses_longhands()
158158
{
159-
$blueprint = $this->fixture('definitions/longhands.bp');
159+
$blueprint = $this->fixture('drafts/longhands.yaml');
160160

161161
$this->assertEquals([
162162
'models' => [
@@ -183,7 +183,7 @@ public function it_parses_longhands()
183183
*/
184184
public function it_parses_resource_shorthands()
185185
{
186-
$blueprint = $this->fixture('definitions/with-timezones.bp');
186+
$blueprint = $this->fixture('drafts/with-timezones.yaml');
187187

188188
$this->assertEquals([
189189
'models' => [
@@ -200,7 +200,7 @@ public function it_parses_resource_shorthands()
200200
*/
201201
public function it_parses_the_readme_example()
202202
{
203-
$blueprint = $this->fixture('definitions/readme-example.bp');
203+
$blueprint = $this->fixture('drafts/readme-example.yaml');
204204

205205
$this->assertEquals([
206206
'models' => [
@@ -235,7 +235,7 @@ public function it_parses_the_readme_example()
235235
*/
236236
public function it_parses_the_readme_example_with_different_platform_eols()
237237
{
238-
$definition = $this->fixture('definitions/readme-example.bp');
238+
$definition = $this->fixture('drafts/readme-example.yaml');
239239

240240
$LF = "\n";
241241
$CR = "\r";
@@ -282,7 +282,7 @@ public function it_throws_a_custom_error_when_parsing_fails()
282282
{
283283
$this->expectException(ParseException::class);
284284

285-
$blueprint = $this->fixture('definitions/invalid.bp');
285+
$blueprint = $this->fixture('drafts/invalid.yaml');
286286

287287
$this->subject->parse($blueprint);
288288
}

tests/Feature/Generator/ControllerGeneratorTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function output_writes_migration_for_controller_tree($definition, $path,
7575
*/
7676
public function output_generates_controllers_with_models_with_custom_namespace_correctly()
7777
{
78-
$definition = 'definitions/custom-models-namespace.bp';
78+
$definition = 'drafts/custom-models-namespace.yaml';
7979
$path = 'app/Http/Controllers/TagController.php';
8080
$controller = 'controllers/custom-models-namespace.php';
8181

@@ -99,7 +99,7 @@ public function output_generates_controllers_with_models_with_custom_namespace_c
9999

100100
$this->assertEquals(['created' => [$path]], $this->subject->output($tree));
101101
}
102-
102+
103103
/**
104104
* @test
105105
*/
@@ -128,7 +128,7 @@ public function output_works_for_pascal_case_definition()
128128
$this->files->expects('put')
129129
->with($certificateTypeController, $this->fixture('controllers/certificate-type-controller.php'));
130130

131-
$tokens = $this->blueprint->parse($this->fixture('definitions/pascal-case.bp'));
131+
$tokens = $this->blueprint->parse($this->fixture('drafts/pascal-case.yaml'));
132132
$tree = $this->blueprint->analyze($tokens);
133133
$this->assertEquals(['created' => [$certificateController, $certificateTypeController]], $this->subject->output($tree));
134134
}
@@ -157,7 +157,7 @@ public function output_respects_configuration()
157157
$this->files->expects('put')
158158
->with('src/path/Other/Http/UserController.php', $this->fixture('controllers/controller-configured.php'));
159159

160-
$tokens = $this->blueprint->parse($this->fixture('definitions/simple-controller.bp'));
160+
$tokens = $this->blueprint->parse($this->fixture('drafts/simple-controller.yaml'));
161161
$tree = $this->blueprint->analyze($tokens);
162162

163163
$this->assertEquals(['created' => ['src/path/Other/Http/UserController.php']], $this->subject->output($tree));
@@ -166,11 +166,11 @@ public function output_respects_configuration()
166166
public function controllerTreeDataProvider()
167167
{
168168
return [
169-
['definitions/readme-example.bp', 'app/Http/Controllers/PostController.php', 'controllers/readme-example.php'],
170-
['definitions/crazy-eloquent.bp', 'app/Http/Controllers/PostController.php', 'controllers/crazy-eloquent.php'],
171-
['definitions/nested-components.bp', 'app/Http/Controllers/Admin/UserController.php', 'controllers/nested-components.php'],
172-
['definitions/respond-statements.bp', 'app/Http/Controllers/Api/PostController.php', 'controllers/respond-statements.php'],
173-
['definitions/resource-statements.bp', 'app/Http/Controllers/UserController.php', 'controllers/resource-statements.php'],
169+
['drafts/readme-example.yaml', 'app/Http/Controllers/PostController.php', 'controllers/readme-example.php'],
170+
['drafts/crazy-eloquent.yaml', 'app/Http/Controllers/PostController.php', 'controllers/crazy-eloquent.php'],
171+
['drafts/nested-components.yaml', 'app/Http/Controllers/Admin/UserController.php', 'controllers/nested-components.php'],
172+
['drafts/respond-statements.yaml', 'app/Http/Controllers/Api/PostController.php', 'controllers/respond-statements.php'],
173+
['drafts/resource-statements.yaml', 'app/Http/Controllers/UserController.php', 'controllers/resource-statements.php'],
174174
];
175175
}
176176
}

tests/Feature/Generator/FactoryGeneratorTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function output_ignores_nullables_if_fake_nullables_configuration_is_set_
8585
$this->files->expects('put')
8686
->with('database/factories/PostFactory.php', $this->fixture('factories/fake-nullables.php'));
8787

88-
$tokens = $this->blueprint->parse($this->fixture('definitions/readme-example.bp'));
88+
$tokens = $this->blueprint->parse($this->fixture('drafts/readme-example.yaml'));
8989
$tree = $this->blueprint->analyze($tokens);
9090

9191
$this->assertEquals(['created' => ['database/factories/PostFactory.php']], $this->subject->output($tree));
@@ -110,7 +110,7 @@ public function output_respects_configuration()
110110
$this->files->expects('put')
111111
->with('database/factories/PostFactory.php', $this->fixture('factories/post-configured.php'));
112112

113-
$tokens = $this->blueprint->parse($this->fixture('definitions/post.bp'));
113+
$tokens = $this->blueprint->parse($this->fixture('drafts/post.yaml'));
114114
$tree = $this->blueprint->analyze($tokens);
115115

116116
$this->assertEquals(['created' => ['database/factories/PostFactory.php']], $this->subject->output($tree));
@@ -134,7 +134,7 @@ public function output_creates_directory_for_nested_components()
134134
$this->files->expects('put')
135135
->with('database/factories/Admin/UserFactory.php', $this->fixture('factories/nested-components.php'));
136136

137-
$tokens = $this->blueprint->parse($this->fixture('definitions/nested-components.bp'));
137+
$tokens = $this->blueprint->parse($this->fixture('drafts/nested-components.yaml'));
138138
$tree = $this->blueprint->analyze($tokens);
139139

140140
$this->assertEquals(['created' => ['database/factories/Admin/UserFactory.php']], $this->subject->output($tree));
@@ -143,15 +143,15 @@ public function output_creates_directory_for_nested_components()
143143
public function modelTreeDataProvider()
144144
{
145145
return [
146-
['definitions/phone.bp', 'database/factories/PhoneFactory.php', 'factories/phone.php'],
147-
['definitions/post.bp', 'database/factories/PostFactory.php', 'factories/post.php'],
148-
['definitions/team.bp', 'database/factories/TeamFactory.php', 'factories/team.php'],
149-
['definitions/unconventional.bp', 'database/factories/TeamFactory.php', 'factories/unconventional.php'],
150-
['definitions/model-modifiers.bp', 'database/factories/ModifierFactory.php', 'factories/model-modifiers.php'],
151-
['definitions/model-key-constraints.bp', 'database/factories/OrderFactory.php', 'factories/model-key-constraints.php'],
152-
['definitions/unconventional-foreign-key.bp', 'database/factories/StateFactory.php', 'factories/unconventional-foreign-key.php'],
153-
['definitions/foreign-key-shorthand.bp', 'database/factories/CommentFactory.php', 'factories/foreign-key-shorthand.php'],
154-
['definitions/resource-statements.bp', 'database/factories/UserFactory.php', 'factories/resource-statements.php'],
146+
['drafts/phone.yaml', 'database/factories/PhoneFactory.php', 'factories/phone.php'],
147+
['drafts/post.yaml', 'database/factories/PostFactory.php', 'factories/post.php'],
148+
['drafts/team.yaml', 'database/factories/TeamFactory.php', 'factories/team.php'],
149+
['drafts/unconventional.yaml', 'database/factories/TeamFactory.php', 'factories/unconventional.php'],
150+
['drafts/model-modifiers.yaml', 'database/factories/ModifierFactory.php', 'factories/model-modifiers.php'],
151+
['drafts/model-key-constraints.yaml', 'database/factories/OrderFactory.php', 'factories/model-key-constraints.php'],
152+
['drafts/unconventional-foreign-key.yaml', 'database/factories/StateFactory.php', 'factories/unconventional-foreign-key.php'],
153+
['drafts/foreign-key-shorthand.yaml', 'database/factories/CommentFactory.php', 'factories/foreign-key-shorthand.php'],
154+
['drafts/resource-statements.yaml', 'database/factories/UserFactory.php', 'factories/resource-statements.php'],
155155
];
156156
}
157157
}

0 commit comments

Comments
 (0)