Skip to content

Commit f6b2bbf

Browse files
committed
Test both Laravel and Lumen without requiring either
1 parent 684c1e5 commit f6b2bbf

File tree

6 files changed

+140
-5
lines changed

6 files changed

+140
-5
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
allow_failures:
1313
- php: hhvm
1414

15-
install: travis_retry composer install --no-interaction --prefer-source
15+
install: travis_retry composer install --no-interaction
1616

17-
script: vendor/bin/phpunit
17+
script: make test
1818

CHANGELOG.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# CHANGELOG
2+
3+
## next release
4+
5+
* Added test coverage for version 5.2 of both Lumen and Laravel.
6+
7+
## 3.0.3 - 2015-09-18
8+
9+
* Added support for configuring credentials with environmental variables, a ini
10+
file at `~/.aws/credentials`, or with Ec2 instance profiles instead of
11+
requiring their inclusion in the `aws.php` config file.
12+
13+
## 3.0.3 - 2015-08-10
14+
15+
* Removed usage of a dev dependency
16+
17+
## 3.0.1 - 2015-08-05
18+
19+
* Provide version information to SDK user agent
20+
21+
## 3.0.0 - 2015-06-10
22+
23+
* Service provider is now compatible with Laravel 5.1 and Version 3 of the AWS
24+
SDK for PHP.
25+
26+
## 2.0.1 - 2015-06-10
27+
28+
* Service provider is now compatible with Lumen
29+
30+
## 2.0.0 - 2015-03-12
31+
32+
* Updated the service provider to work with Laravel 5.
33+
34+
## 1.1.2 - 2015-02-13
35+
36+
* Added alias to support DI from container.
37+
38+
## 1.1.1 - 2014-05-12
39+
40+
* Updated default module config file to make it more compatible with environment
41+
credentials
42+
43+
## 1.1.0 - 2013-09-03
44+
45+
* Added package-level config that can be published with Artisan
46+
* Updated config loading logic to support package-level config
47+
* Updated config loading logic to support AWS SDK for PHP config files via the
48+
`config_file` key
49+
* Updated code, tests, and the README to support the config refactoring
50+
* This module is now following [semver](http://semver.org/)
51+
52+
## 1.0.4 - 2013-06-20
53+
54+
* Added support for the AWS facade
55+
* Updated `composer.json` to require only specific components of Laravel
56+
* Updated `composer.json` to require version 2.2+ of the AWS SDK for PHP
57+
58+
## 1.0.3 - 2013-04-25
59+
60+
* Update Composer dependencies to work with newer version of the AWS SDK for PHP
61+
and Laravel
62+
63+
## 1.0.2 - 2013-03-11
64+
65+
* Fixed an issue with config retrieval
66+
67+
## 1.0.1 - 2013-03-07
68+
69+
* Improved usage instructions in the README
70+
* Fixed logic for retrieving Laravel version
71+
72+
## 1.0.0 - 2013-02-13
73+
74+
* Initial release.

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
test: test-laravel test-lumen
2+
3+
test-laravel:
4+
composer require laravel/framework
5+
vendor/bin/phpunit
6+
make uninstall-laravel
7+
8+
test-lumen:
9+
composer require laravel/lumen-framework
10+
vendor/bin/phpunit
11+
make uninstall-lumen
12+
13+
uninstall-illuminate:
14+
rm -rf vendor/laravel
15+
rm -rf vendor/illuminate
16+
17+
uninstall-laravel: uninstall-illuminate
18+
composer remove laravel/framework
19+
20+
uninstall-lumen: uninstall-illuminate
21+
composer remove laravel/lumen-framework
22+
23+
# Ensures that the TAG variable was passed to the make command
24+
check-tag:
25+
$(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))
26+
27+
# Creates a release but does not push it. This task updates the changelog
28+
# with the TAG environment variable, replaces the VERSION constant, ensures
29+
# that the source is still valid after updating, commits the changelog and
30+
# updated VERSION constant, creates an annotated git tag using chag, and
31+
# prints out a diff of the last commit.
32+
tag: check-tag test
33+
@echo Tagging $(TAG)
34+
chag update $(TAG)
35+
sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/AwsServiceProvider.php
36+
php -l src/AwsBundle.php
37+
git commit -a -m '$(TAG) release'
38+
chag tag
39+
@echo "Release has been created. Push using 'make release'"
40+
@echo "Changes made in the release commit"
41+
git diff HEAD~1 HEAD

composer.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
"illuminate/support": "~5.1"
1818
},
1919
"require-dev": {
20-
"laravel/framework": "~5.2",
21-
"phpunit/phpunit": "~4.0",
22-
"laravel/lumen-framework": "~5.2"
20+
"phpunit/phpunit": "~4.0|~5.0"
21+
},
22+
"suggest": {
23+
"laravel/framework": "To test the Laravel bindings",
24+
"laravel/lumen-framework": "To test the Lumen bindings"
2325
},
2426
"autoload": {
2527
"psr-4": { "Aws\\Laravel\\": "src/" }

tests/LaravelAwsServiceProviderTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55

66
class LaravelAwsServiceProviderTest extends AwsServiceProviderTest
77
{
8+
public function setUp()
9+
{
10+
if (!class_exists(Application::class)) {
11+
$this->markTestSkipped();
12+
}
13+
14+
parent::setUp();
15+
}
16+
817
protected function setupApplication()
918
{
1019
// Create the application such that the config is loaded.

tests/LumenAwsServiceProviderTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66

77
class LumenAwsServiceProviderTest extends AwsServiceProviderTest
88
{
9+
public function setUp()
10+
{
11+
if (!class_exists(Application::class)) {
12+
$this->markTestSkipped();
13+
}
14+
15+
parent::setUp();
16+
}
17+
918
protected function setupApplication()
1019
{
1120
// Create the application such that the config is loaded.

0 commit comments

Comments
 (0)