Skip to content

Commit a5e5ffb

Browse files
committed
try
1 parent 2e2aff8 commit a5e5ffb

12 files changed

+85
-255
lines changed

phpunit.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
33
<coverage/>
4-
<metadata>
5-
<include-annotations>true</include-annotations>
6-
</metadata>
74
<testsuites>
85
<testsuite name="unit">
96
<directory>tests/Unit</directory>

tests/Unit/Commands/ActivateTest.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ public function assertEvents($deployed = true, $activated = true)
6666
Event::assertNotDispatched(AfterFunctionsActivated::class);
6767
}
6868
}
69-
70-
/** @test */
71-
public function it_should_activate_functions()
69+
public function test_it_should_activate_functions()
7270
{
7371
$this->mockActivating();
7472

@@ -87,9 +85,7 @@ protected function mockInvokeAsync($with = [], $return = null)
8785
{
8886
return $this->mockMethod('invokeAsync', $with, $return);
8987
}
90-
91-
/** @test */
92-
public function it_should_pre_warm_functions_if_the_latest_version_is_different()
88+
public function test_it_should_pre_warm_functions_if_the_latest_version_is_different()
9389
{
9490
// The latest version is not the active version.
9591
$this->lambda->shouldReceive('latestVersionHasAlias')
@@ -127,9 +123,7 @@ public function it_should_pre_warm_functions_if_the_latest_version_is_different(
127123

128124
$this->artisan('sidecar:activate --pre-warm');
129125
}
130-
131-
/** @test */
132-
public function it_should_not_pre_warm_functions_if_the_latest_version_is_the_same()
126+
public function test_it_should_not_pre_warm_functions_if_the_latest_version_is_the_same()
133127
{
134128
$this->lambda->shouldReceive('latestVersionHasAlias')
135129
->andReturn(true);
@@ -151,9 +145,7 @@ public function it_should_not_pre_warm_functions_if_the_latest_version_is_the_sa
151145

152146
$this->artisan('sidecar:activate --pre-warm');
153147
}
154-
155-
/** @test */
156-
public function it_should_activate_functions_with_env()
148+
public function test_it_should_activate_functions_with_env()
157149
{
158150
$this->mockActivating();
159151

tests/Unit/Commands/ConfigureTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ protected function createRolePayload()
156156
]),
157157
];
158158
}
159-
160-
/** @test */
161-
public function basic_happy_path()
159+
public function test_basic_happy_path()
162160
{
163161
$this->mockS3(function ($mock) {
164162
$this->mockHeadBucketNotFound($mock);

tests/Unit/Commands/DeployTest.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
class DeployTest extends DeploymentTest
1313
{
14-
/** @test */
15-
public function it_deploys_the_functions_in_the_config()
14+
public function test_it_deploys_the_functions_in_the_config()
1615
{
1716
$this->lambda->shouldReceive('functionExists')->andReturn(false);
1817
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -26,9 +25,7 @@ public function it_deploys_the_functions_in_the_config()
2625

2726
$this->assertEvents($deployed = true, $activated = false);
2827
}
29-
30-
/** @test */
31-
public function it_deploys_and_activates_the_functions_in_the_config()
28+
public function test_it_deploys_and_activates_the_functions_in_the_config()
3229
{
3330
$this->lambda->shouldReceive('functionExists')->andReturn(false);
3431
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -45,9 +42,7 @@ public function it_deploys_and_activates_the_functions_in_the_config()
4542

4643
$this->assertEvents($deployed = true, $activated = true);
4744
}
48-
49-
/** @test */
50-
public function it_uses_a_fake_environment()
45+
public function test_it_uses_a_fake_environment()
5146
{
5247
$this->lambda->shouldReceive('functionExists')->andReturn(false);
5348
$this->lambda->shouldReceive('getVersions')->andReturn([]);

tests/Unit/DeploymentTest.php

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ public function assertEvents($deployed = true, $activated = true)
110110
Event::assertNotDispatched(AfterFunctionsActivated::class);
111111
}
112112
}
113-
114-
/** @test */
115-
public function it_deploys_a_function_that_doesnt_exist()
113+
public function test_it_deploys_a_function_that_doesnt_exist()
116114
{
117115
$this->lambda->shouldReceive('functionExists')->andReturn(false);
118116
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -122,9 +120,7 @@ public function it_deploys_a_function_that_doesnt_exist()
122120

123121
$this->assertEvents($deployed = true, $activated = false);
124122
}
125-
126-
/** @test */
127-
public function it_deploys_a_function_that_doesnt_exist_from_the_deployment_class()
123+
public function test_it_deploys_a_function_that_doesnt_exist_from_the_deployment_class()
128124
{
129125
$this->lambda->shouldReceive('functionExists')->andReturn(false);
130126
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -134,9 +130,7 @@ public function it_deploys_a_function_that_doesnt_exist_from_the_deployment_clas
134130

135131
$this->assertEvents($deployed = true, $activated = false);
136132
}
137-
138-
/** @test */
139-
public function it_deploys_an_array_of_functions()
133+
public function test_it_deploys_an_array_of_functions()
140134
{
141135
$this->lambda->shouldReceive('functionExists')->andReturn(false);
142136
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -146,9 +140,7 @@ public function it_deploys_an_array_of_functions()
146140

147141
$this->assertEvents($deployed = true, $activated = false);
148142
}
149-
150-
/** @test */
151-
public function it_deploys_the_functions_in_the_config()
143+
public function test_it_deploys_the_functions_in_the_config()
152144
{
153145
$this->lambda->shouldReceive('functionExists')->andReturn(false);
154146
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -162,9 +154,7 @@ public function it_deploys_the_functions_in_the_config()
162154

163155
$this->assertEvents($deployed = true, $activated = false);
164156
}
165-
166-
/** @test */
167-
public function it_deploys_and_activates_a_function_that_doesnt_exist()
157+
public function test_it_deploys_and_activates_a_function_that_doesnt_exist()
168158
{
169159
$this->lambda->shouldReceive('functionExists')->andReturn(false);
170160
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -175,9 +165,7 @@ public function it_deploys_and_activates_a_function_that_doesnt_exist()
175165

176166
$this->assertEvents($deployed = true, $activated = true);
177167
}
178-
179-
/** @test */
180-
public function it_updates_an_existing_function()
168+
public function test_it_updates_an_existing_function()
181169
{
182170
$this->lambda->shouldReceive('functionExists')->andReturn(true);
183171
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -189,9 +177,7 @@ public function it_updates_an_existing_function()
189177

190178
$this->assertEvents($deployed = true, $activated = false);
191179
}
192-
193-
/** @test */
194-
public function it_updates_and_activates_an_existing_function()
180+
public function test_it_updates_and_activates_an_existing_function()
195181
{
196182
$this->lambda->shouldReceive('functionExists')->andReturn(true);
197183
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -204,9 +190,7 @@ public function it_updates_and_activates_an_existing_function()
204190

205191
$this->assertEvents($deployed = true, $activated = true);
206192
}
207-
208-
/** @test */
209-
public function it_sets_environment_variables()
193+
public function test_it_sets_environment_variables()
210194
{
211195
$this->lambda->shouldReceive('functionExists')->andReturn(true);
212196
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -245,9 +229,7 @@ public function it_sets_environment_variables()
245229

246230
$this->assertEvents($deployed = true, $activated = true);
247231
}
248-
249-
/** @test */
250-
public function it_doesnt_change_variables_that_havent_changed()
232+
public function test_it_doesnt_change_variables_that_havent_changed()
251233
{
252234
$this->lambda->shouldReceive('functionExists')->andReturn(true);
253235
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -271,9 +253,7 @@ public function it_doesnt_change_variables_that_havent_changed()
271253

272254
$this->assertEvents($deployed = true, $activated = true);
273255
}
274-
275-
/** @test */
276-
public function it_sets_function_tags()
256+
public function test_it_sets_function_tags()
277257
{
278258
$this->lambda->shouldReceive('functionExists')->andReturn(false);
279259
$this->lambda->shouldReceive('getVersions')->andReturn([]);
@@ -324,9 +304,7 @@ public function it_sets_function_tags()
324304

325305
$this->assertEvents($deployed = true, $activated = true);
326306
}
327-
328-
/** @test */
329-
public function it_throws_an_exception_if_there_are_no_functions()
307+
public function test_it_throws_an_exception_if_there_are_no_functions()
330308
{
331309
config()->set('sidecar.functions', [
332310

tests/Unit/EnvironmentMismatchTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ protected function mockInvokeNonExistent()
4040
->once()
4141
->andThrow($this->notFoundException());
4242
}
43-
44-
/** @test */
45-
public function it_throws_the_right_exception()
43+
public function test_it_throws_the_right_exception()
4644
{
4745
$this->mockInvokeNonExistent();
4846

tests/Unit/EnvironmentTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
class EnvironmentTest extends Base
1212
{
13-
/** @test */
14-
public function it_can_be_overridden()
13+
public function test_it_can_be_overridden()
1514
{
1615
$this->assertEquals('testing', Sidecar::getEnvironment());
1716

@@ -23,9 +22,7 @@ public function it_can_be_overridden()
2322

2423
$this->assertEquals('testing', Sidecar::getEnvironment());
2524
}
26-
27-
/** @test */
28-
public function precedence_is_correct()
25+
public function test_precedence_is_correct()
2926
{
3027
Sidecar::clearEnvironment();
3128

tests/Unit/ExecuteMultipleTest.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ protected function mockMultiple()
7777
]))
7878
->andReturn($result);
7979
}
80-
81-
/** @test */
82-
public function execute_many_by_function()
80+
public function test_execute_many_by_function()
8381
{
8482
$this->mockMultiple();
8583

@@ -93,9 +91,7 @@ public function execute_many_by_function()
9391

9492
$this->assertEvents(3);
9593
}
96-
97-
/** @test */
98-
public function execute_many_by_facade()
94+
public function test_execute_many_by_facade()
9995
{
10096
$this->mockMultiple();
10197

@@ -109,9 +105,7 @@ public function execute_many_by_facade()
109105

110106
$this->assertEvents(3);
111107
}
112-
113-
/** @test */
114-
public function execute_many_by_facade_with_instantiated_class()
108+
public function test_execute_many_by_facade_with_instantiated_class()
115109
{
116110
$this->mockMultiple();
117111

@@ -125,9 +119,7 @@ public function execute_many_by_facade_with_instantiated_class()
125119

126120
$this->assertEvents(3);
127121
}
128-
129-
/** @test */
130-
public function execute_many_by_function_int()
122+
public function test_execute_many_by_function_int()
131123
{
132124
$result = Mockery::mock(PromiseInterface::class)
133125
->shouldReceive('wait')
@@ -143,9 +135,7 @@ public function execute_many_by_function_int()
143135

144136
$this->assertEvents(5);
145137
}
146-
147-
/** @test */
148-
public function execute_many_by_facade_int()
138+
public function test_execute_many_by_facade_int()
149139
{
150140
$result = Mockery::mock(PromiseInterface::class)
151141
->shouldReceive('wait')
@@ -161,9 +151,7 @@ public function execute_many_by_facade_int()
161151

162152
$this->assertEvents(5);
163153
}
164-
165-
/** @test */
166-
public function execute_many_by_facade_int_with_instantiated_class()
154+
public function test_execute_many_by_facade_int_with_instantiated_class()
167155
{
168156
$result = Mockery::mock(PromiseInterface::class)
169157
->shouldReceive('wait')
@@ -179,9 +167,7 @@ public function execute_many_by_facade_int_with_instantiated_class()
179167

180168
$this->assertEvents(5);
181169
}
182-
183-
/** @test */
184-
public function execute_many_async_by_function()
170+
public function test_execute_many_async_by_function()
185171
{
186172
$result = Mockery::mock(PromiseInterface::class)
187173
->shouldNotReceive('wait')

0 commit comments

Comments
 (0)