From 423e2b7c3fa2e272daa826e57297af83f3056145 Mon Sep 17 00:00:00 2001 From: Patrick Henninger Date: Fri, 28 Dec 2018 17:00:55 +0100 Subject: [PATCH] Restructuring Added codecov --- .travis.yml | 17 ++++++++++++++++- phpunit.xml | 10 +++++++--- {config => src/Config}/cart.php | 0 ...8_12_23_120000_create_shoppingcart_table.php | 0 src/ShoppingcartServiceProvider.php | 6 +++--- tests/CartTest.php | 2 +- 6 files changed, 27 insertions(+), 8 deletions(-) rename {config => src/Config}/cart.php (100%) rename {database => src/Database}/migrations/2018_12_23_120000_create_shoppingcart_table.php (100%) diff --git a/.travis.yml b/.travis.yml index 2eacae4..c22deb7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,19 @@ before_script: - composer self-update - composer install --prefer-source --no-interaction -script: vendor/bin/phpunit \ No newline at end of file +script: +- vendor/bin/phpunit --coverage-clover=coverage.xml + +after_success: +# Submit coverage report to https://codecov.io +- bash <(curl -s https://codecov.io/bash) + +# Monitor only these branches +branches: + only: + - master + +# You can delete the cache using travis-ci web interface +cache: + directories: + - $HOME/.composer/cache \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index f994f39..7c286ab 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,11 +7,15 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> - + ./tests/ + + + ./src + + \ No newline at end of file diff --git a/config/cart.php b/src/Config/cart.php similarity index 100% rename from config/cart.php rename to src/Config/cart.php diff --git a/database/migrations/2018_12_23_120000_create_shoppingcart_table.php b/src/Database/migrations/2018_12_23_120000_create_shoppingcart_table.php similarity index 100% rename from database/migrations/2018_12_23_120000_create_shoppingcart_table.php rename to src/Database/migrations/2018_12_23_120000_create_shoppingcart_table.php diff --git a/src/ShoppingcartServiceProvider.php b/src/ShoppingcartServiceProvider.php index 691df87..c7a4b39 100644 --- a/src/ShoppingcartServiceProvider.php +++ b/src/ShoppingcartServiceProvider.php @@ -18,10 +18,10 @@ class ShoppingcartServiceProvider extends ServiceProvider { $this->app->bind('cart', 'Gloudemans\Shoppingcart\Cart'); - $config = __DIR__ . '/../config/cart.php'; + $config = __DIR__ . '/Config/cart.php'; $this->mergeConfigFrom($config, 'cart'); - $this->publishes([__DIR__ . '/../config/cart.php' => config_path('cart.php')], 'config'); + $this->publishes([__DIR__ . '/Config/cart.php' => config_path('cart.php')], 'config'); $this->app['events']->listen(Logout::class, function () { if ($this->app['config']->get('cart.destroy_on_logout')) { @@ -30,7 +30,7 @@ class ShoppingcartServiceProvider extends ServiceProvider }); $this->publishes([ - realpath(__DIR__.'/../database/migrations') => $this->app->databasePath().'/migrations' + realpath(__DIR__.'/Database/migrations') => $this->app->databasePath().'/migrations' ]); } } diff --git a/tests/CartTest.php b/tests/CartTest.php index fbb93f2..52d6127 100644 --- a/tests/CartTest.php +++ b/tests/CartTest.php @@ -61,7 +61,7 @@ class CartTest extends TestCase parent::setUp(); $this->app->afterResolving('migrator', function ($migrator) { - $migrator->path(realpath(__DIR__.'/../database/migrations')); + $migrator->path(realpath(__DIR__.'/../src/Database/migrations')); }); }