Skip to content

Commit 9df660e

Browse files
Fix CS
1 parent 94b3797 commit 9df660e

8 files changed

+1597
-1550
lines changed

tests/Configurator/AddLinesConfiguratorTest.php

Lines changed: 231 additions & 237 deletions
Large diffs are not rendered by default.

tests/Configurator/BundlesConfiguratorTest.php

Lines changed: 75 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,27 @@ public function testConfigure()
4141
'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all'],
4242
], $lock);
4343
$this->assertEquals(<<<EOF
44-
<?php
44+
<?php
4545
46-
return [
47-
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
48-
FooBundle::class => ['dev' => true, 'test' => true],
49-
];
46+
return [
47+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
48+
FooBundle::class => ['dev' => true, 'test' => true],
49+
];
5050
51-
EOF
52-
, file_get_contents($config));
51+
EOF,
52+
file_get_contents($config)
53+
);
5354
}
5455

5556
public function testConfigureWhenBundlesAlreadyExists()
5657
{
5758
$this->saveBundlesFile(<<<EOF
58-
<?php
59+
<?php
5960
60-
return [
61-
BarBundle::class => ['prod' => false, 'all' => true],
62-
];
63-
EOF
61+
return [
62+
BarBundle::class => ['prod' => false, 'all' => true],
63+
];
64+
EOF
6465
);
6566

6667
$configurator = new BundlesConfigurator(
@@ -77,29 +78,30 @@ public function testConfigureWhenBundlesAlreadyExists()
7778
'Symfony\Bundle\FrameworkBundle\FrameworkBundle' => ['all'],
7879
], $lock);
7980
$this->assertEquals(<<<EOF
80-
<?php
81+
<?php
8182
82-
return [
83-
BarBundle::class => ['prod' => false, 'all' => true],
84-
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
85-
FooBundle::class => ['dev' => true, 'test' => true],
86-
];
83+
return [
84+
BarBundle::class => ['prod' => false, 'all' => true],
85+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
86+
FooBundle::class => ['dev' => true, 'test' => true],
87+
];
8788
88-
EOF
89-
, file_get_contents(FLEX_TEST_DIR.'/config/bundles.php'));
89+
EOF,
90+
file_get_contents(FLEX_TEST_DIR.'/config/bundles.php')
91+
);
9092
}
9193

9294
public function testUnconfigure()
9395
{
9496
$this->saveBundlesFile(<<<EOF
95-
<?php
96-
97-
return [
98-
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
99-
BarBundle::class => ['prod' => false, 'all' => true],
100-
OtherBundle::class => ['all' => true],
101-
];
102-
EOF
97+
<?php
98+
99+
return [
100+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
101+
BarBundle::class => ['prod' => false, 'all' => true],
102+
OtherBundle::class => ['all' => true],
103+
];
104+
EOF
103105
);
104106

105107
$configurator = new BundlesConfigurator(
@@ -115,15 +117,16 @@ public function testUnconfigure()
115117
'BarBundle' => ['dev', 'all'],
116118
], $lock);
117119
$this->assertEquals(<<<EOF
118-
<?php
120+
<?php
119121
120-
return [
121-
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
122-
OtherBundle::class => ['all' => true],
123-
];
122+
return [
123+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
124+
OtherBundle::class => ['all' => true],
125+
];
124126
125-
EOF
126-
, file_get_contents(FLEX_TEST_DIR.'/config/bundles.php'));
127+
EOF,
128+
file_get_contents(FLEX_TEST_DIR.'/config/bundles.php')
129+
);
127130
}
128131

129132
public function testUpdate()
@@ -142,14 +145,14 @@ public function testUpdate()
142145
);
143146

144147
$this->saveBundlesFile(<<<EOF
145-
<?php
146-
147-
return [
148-
BarBundle::class => ['prod' => false, 'all' => true],
149-
FooBundle::class => ['dev' => true, 'test' => true],
150-
BazBundle::class => ['all' => true],
151-
];
152-
EOF
148+
<?php
149+
150+
return [
151+
BarBundle::class => ['prod' => false, 'all' => true],
152+
FooBundle::class => ['dev' => true, 'test' => true],
153+
BazBundle::class => ['all' => true],
154+
];
155+
EOF
153156
);
154157

155158
$configurator->update(
@@ -158,31 +161,39 @@ public function testUpdate()
158161
['FooBundle' => ['all'], 'NewBundle' => ['all']]
159162
);
160163

161-
$this->assertSame(['config/bundles.php' => <<<EOF
162-
<?php
164+
$this->assertSame(
165+
[
166+
'config/bundles.php' => <<<EOF
167+
<?php
163168
164-
return [
165-
BarBundle::class => ['prod' => false, 'all' => true],
166-
FooBundle::class => ['dev' => true, 'test' => true],
167-
BazBundle::class => ['all' => true],
168-
];
169+
return [
170+
BarBundle::class => ['prod' => false, 'all' => true],
171+
FooBundle::class => ['dev' => true, 'test' => true],
172+
BazBundle::class => ['all' => true],
173+
];
169174
170-
EOF
171-
], $recipeUpdate->getOriginalFiles());
175+
EOF,
176+
],
177+
$recipeUpdate->getOriginalFiles()
178+
);
172179

173180
// FooBundle::class => ['dev' => true, 'test' => true]: configured envs should not be overwritten
174-
$this->assertSame(['config/bundles.php' => <<<EOF
175-
<?php
176-
177-
return [
178-
BarBundle::class => ['prod' => false, 'all' => true],
179-
FooBundle::class => ['all' => true],
180-
BazBundle::class => ['all' => true],
181-
NewBundle::class => ['all' => true],
182-
];
183-
184-
EOF
185-
], $recipeUpdate->getNewFiles());
181+
$this->assertSame(
182+
[
183+
'config/bundles.php' => <<<EOF
184+
<?php
185+
186+
return [
187+
BarBundle::class => ['prod' => false, 'all' => true],
188+
FooBundle::class => ['all' => true],
189+
BazBundle::class => ['all' => true],
190+
NewBundle::class => ['all' => true],
191+
];
192+
193+
EOF,
194+
],
195+
$recipeUpdate->getNewFiles()
196+
);
186197
}
187198

188199
private function saveBundlesFile(string $contents)

tests/Configurator/ComposerScriptsConfiguratorTest.php

Lines changed: 67 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,24 @@ public function testConfigure()
7070
'do:cool-stuff' => 'symfony-cmd',
7171
], $lock);
7272
$this->assertEquals(<<<EOF
73-
{
74-
"scripts": {
75-
"auto-scripts": {
76-
"cache:clear": "symfony-cmd",
77-
"assets:install %PUBLIC_DIR%": "symfony-cmd",
78-
"do:cool-stuff": "symfony-cmd"
79-
},
80-
"post-install-cmd": [
81-
"@auto-scripts"
82-
],
83-
"post-update-cmd": [
84-
"@auto-scripts"
85-
]
86-
}
87-
}
88-
89-
EOF
90-
, file_get_contents(FLEX_TEST_DIR.'/composer.json')
73+
{
74+
"scripts": {
75+
"auto-scripts": {
76+
"cache:clear": "symfony-cmd",
77+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
78+
"do:cool-stuff": "symfony-cmd"
79+
},
80+
"post-install-cmd": [
81+
"@auto-scripts"
82+
],
83+
"post-update-cmd": [
84+
"@auto-scripts"
85+
]
86+
}
87+
}
88+
89+
EOF,
90+
file_get_contents(FLEX_TEST_DIR.'/composer.json')
9191
);
9292
}
9393

@@ -118,22 +118,22 @@ public function testUnconfigure()
118118
'cache:clear' => 'symfony-cmd',
119119
], $lock);
120120
$this->assertEquals(<<<EOF
121-
{
122-
"scripts": {
123-
"auto-scripts": {
124-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
125-
},
126-
"post-install-cmd": [
127-
"@auto-scripts"
128-
],
129-
"post-update-cmd": [
130-
"@auto-scripts"
131-
]
132-
}
133-
}
134-
135-
EOF
136-
, file_get_contents(FLEX_TEST_DIR.'/composer.json')
121+
{
122+
"scripts": {
123+
"auto-scripts": {
124+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
125+
},
126+
"post-install-cmd": [
127+
"@auto-scripts"
128+
],
129+
"post-update-cmd": [
130+
"@auto-scripts"
131+
]
132+
}
133+
}
134+
135+
EOF,
136+
file_get_contents(FLEX_TEST_DIR.'/composer.json')
137137
);
138138
}
139139

@@ -170,44 +170,42 @@ public function testUpdate()
170170
);
171171

172172
$expectedComposerJsonOriginal = <<<EOF
173-
{
174-
"scripts": {
175-
"auto-scripts": {
176-
"cache:clear": "symfony-cmd",
177-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
178-
},
179-
"post-install-cmd": [
180-
"@auto-scripts"
181-
],
182-
"post-update-cmd": [
183-
"@auto-scripts"
184-
]
185-
}
186-
}
187-
188-
EOF
189-
;
173+
{
174+
"scripts": {
175+
"auto-scripts": {
176+
"cache:clear": "symfony-cmd",
177+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
178+
},
179+
"post-install-cmd": [
180+
"@auto-scripts"
181+
],
182+
"post-update-cmd": [
183+
"@auto-scripts"
184+
]
185+
}
186+
}
187+
188+
EOF;
190189
$this->assertSame(['composer.json' => $expectedComposerJsonOriginal], $recipeUpdate->getOriginalFiles());
191190

192191
$expectedComposerJsonNew = <<<EOF
193-
{
194-
"scripts": {
195-
"auto-scripts": {
196-
"cache:clear": "other-cmd",
197-
"assets:install %PUBLIC_DIR%": "symfony-cmd",
198-
"do:cool-stuff": "symfony-cmd"
199-
},
200-
"post-install-cmd": [
201-
"@auto-scripts"
202-
],
203-
"post-update-cmd": [
204-
"@auto-scripts"
205-
]
206-
}
207-
}
208-
209-
EOF
210-
;
192+
{
193+
"scripts": {
194+
"auto-scripts": {
195+
"cache:clear": "other-cmd",
196+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
197+
"do:cool-stuff": "symfony-cmd"
198+
},
199+
"post-install-cmd": [
200+
"@auto-scripts"
201+
],
202+
"post-update-cmd": [
203+
"@auto-scripts"
204+
]
205+
}
206+
}
207+
208+
EOF;
211209
$this->assertSame(['composer.json' => $expectedComposerJsonNew], $recipeUpdate->getNewFiles());
212210
}
213211
}

0 commit comments

Comments
 (0)