From b4ea82f327ba4aee845af26b5e85cbdd1fd441ad Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Thu, 8 Feb 2018 11:07:21 -0600 Subject: [PATCH] Cleanup of the test classes and remove superfluous dependencies --- composer.json | 48 +++--- composer.lock | 407 ++++++--------------------------------------- config/app.php | 2 - config/version.yml | 2 +- tests/ApiTest.php | 4 +- tests/TestCase.php | 67 +++----- 6 files changed, 98 insertions(+), 432 deletions(-) diff --git a/composer.json b/composer.json index 514646dc..2b5fbf76 100755 --- a/composer.json +++ b/composer.json @@ -10,31 +10,30 @@ "php": ">=7.1", "laravel/framework": "5.5.*", "php-http/httplug": "1.1.0", - "laravelcollective/html": "5.5.1", - "prettus/l5-repository": "2.6.32", - "spatie/laravel-pjax": "1.3.1", - "league/geotools": "0.7.0", - "toin0u/geotools-laravel": "^1.0", - "webpatser/laravel-uuid": "3.0.1", - "spatie/laravel-fractal": "5.3.0", - "composer/semver": "1.4.2", - "hashids/hashids": "2.0.4", - "nwidart/laravel-modules": "2.6.0", - "sebastiaanluca/laravel-helpers": "1.0.2", + "laravelcollective/html": "5.5.x", + "prettus/l5-repository": "2.6.x", + "spatie/laravel-pjax": "1.3.x", + "league/geotools": "0.7.x", + "toin0u/geotools-laravel": "1.0.x", + "webpatser/laravel-uuid": "3.0.x", + "composer/semver": "1.4.x", + "hashids/hashids": "2.0.x", + "nwidart/laravel-modules": "2.6.x", + "sebastiaanluca/laravel-helpers": "1.0.x", "jackiedo/timezonelist": "5.x", - "tivie/php-os-detector": "1.1.0", - "santigarcor/laratrust": "5.0.3", - "pragmarx/version": "0.2.3", - "guzzlehttp/guzzle": "6.3.0", - "jmikola/geojson": "1.0.2", - "laracasts/flash": "3.0.2", - "arrilot/laravel-widgets": "3.9.0", - "nabeel/vacentral": "1.0.*", - "league/iso3166": "^2.1", - "google/apiclient": "^2.0", - "theiconic/php-ga-measurement-protocol": "^2.0", - "irazasyed/laravel-gamp": "^1.3", - "vierbergenlars/php-semver": "^3.0" + "tivie/php-os-detector": "1.1.x", + "santigarcor/laratrust": "5.0.x", + "pragmarx/version": "0.2.x", + "guzzlehttp/guzzle": "6.3.x", + "jmikola/geojson": "1.0.x", + "laracasts/flash": "3.0.x", + "arrilot/laravel-widgets": "3.9.x", + "nabeel/vacentral": "1.0.x", + "league/iso3166": "2.1.x", + "google/apiclient": "2.2.x", + "theiconic/php-ga-measurement-protocol": "2.7.x", + "irazasyed/laravel-gamp": "1.3.x", + "vierbergenlars/php-semver": "3.0.x" }, "require-dev": { "phpunit/phpunit": "6.4.0", @@ -42,7 +41,6 @@ "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "filp/whoops": "~2.0", - "orchestra/testbench": "3.5.2", "bpocallaghan/generators": "5.0.1", "scriptfusion/phpunit-immediate-exception-printer": "1.3.0", "zircote/swagger-php": "2.0.13" diff --git a/composer.lock b/composer.lock index 37d3fb91..54c9a66a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "eb014a7f0acf5c06297051ac5c394de0", + "content-hash": "c9fd9ce3b1fd392712401b78ed1afa92", "packages": [ { "name": "arrilot/laravel-widgets", @@ -1173,16 +1173,16 @@ }, { "name": "laravel/framework", - "version": "v5.5.33", + "version": "v5.5.34", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "ef7880e665390f999f4def7c9f78133636f973cf" + "reference": "1de7c0aec13eadbdddc2d1ba4019b064b2c6b966" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/ef7880e665390f999f4def7c9f78133636f973cf", - "reference": "ef7880e665390f999f4def7c9f78133636f973cf", + "url": "https://api.github.com/repos/laravel/framework/zipball/1de7c0aec13eadbdddc2d1ba4019b064b2c6b966", + "reference": "1de7c0aec13eadbdddc2d1ba4019b064b2c6b966", "shasum": "" }, "require": { @@ -1303,7 +1303,7 @@ "framework", "laravel" ], - "time": "2018-01-30T15:06:13+00:00" + "time": "2018-02-06T15:36:55+00:00" }, { "name": "laravelcollective/html", @@ -1454,70 +1454,6 @@ ], "time": "2018-01-27T16:03:56+00:00" }, - { - "name": "league/fractal", - "version": "0.17.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/fractal.git", - "reference": "a0b350824f22fc2fdde2500ce9d6851a3f275b0e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/fractal/zipball/a0b350824f22fc2fdde2500ce9d6851a3f275b0e", - "reference": "a0b350824f22fc2fdde2500ce9d6851a3f275b0e", - "shasum": "" - }, - "require": { - "php": ">=5.4" - }, - "require-dev": { - "doctrine/orm": "^2.5", - "illuminate/contracts": "~5.0", - "mockery/mockery": "~0.9", - "pagerfanta/pagerfanta": "~1.0.0", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5", - "zendframework/zend-paginator": "~2.3" - }, - "suggest": { - "illuminate/pagination": "The Illuminate Pagination component.", - "pagerfanta/pagerfanta": "Pagerfanta Paginator", - "zendframework/zend-paginator": "Zend Framework Paginator" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.13-dev" - } - }, - "autoload": { - "psr-4": { - "League\\Fractal\\": "src" - } - }, - "notification-url": "http://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Phil Sturgeon", - "email": "me@philsturgeon.uk", - "homepage": "http://philsturgeon.uk/", - "role": "Developer" - } - ], - "description": "Handle the output of complex data structures ready for API output.", - "homepage": "http://fractal.thephpleague.com/", - "keywords": [ - "api", - "json", - "league", - "rest" - ], - "time": "2017-06-12T11:04:56+00:00" - }, { "name": "league/geotools", "version": "0.7.0", @@ -2223,20 +2159,20 @@ }, { "name": "pragmarx/version", - "version": "v0.2.3", + "version": "v0.2.4", "source": { "type": "git", "url": "https://github.com/antonioribeiro/version.git", - "reference": "57484787aa71f85de50cd920f3f701beb23ed928" + "reference": "380efdee0e0ef6c2f864d23b5df09fdd34690390" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/version/zipball/57484787aa71f85de50cd920f3f701beb23ed928", - "reference": "57484787aa71f85de50cd920f3f701beb23ed928", + "url": "https://api.github.com/repos/antonioribeiro/version/zipball/380efdee0e0ef6c2f864d23b5df09fdd34690390", + "reference": "380efdee0e0ef6c2f864d23b5df09fdd34690390", "shasum": "" }, "require": { - "laravel/framework": "^5.5", + "laravel/framework": "5.5.*", "php": "^7.0", "pragmarx/yaml": "^0.1", "symfony/process": "^3.3" @@ -2280,7 +2216,7 @@ "version", "versioning" ], - "time": "2017-12-18T16:17:09+00:00" + "time": "2018-01-09T14:51:48+00:00" }, { "name": "pragmarx/yaml", @@ -2855,16 +2791,16 @@ }, { "name": "santigarcor/laratrust", - "version": "5.0.3", + "version": "5.0.8", "source": { "type": "git", "url": "https://github.com/santigarcor/laratrust.git", - "reference": "dcded937608c4b8e356968597903925a61fa06c5" + "reference": "ae86b729850bcb0dba0189cdbdf3f379046f18b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/dcded937608c4b8e356968597903925a61fa06c5", - "reference": "dcded937608c4b8e356968597903925a61fa06c5", + "url": "https://api.github.com/repos/santigarcor/laratrust/zipball/ae86b729850bcb0dba0189cdbdf3f379046f18b8", + "reference": "ae86b729850bcb0dba0189cdbdf3f379046f18b8", "shasum": "" }, "require": { @@ -2920,7 +2856,7 @@ "rbac", "roles" ], - "time": "2017-12-02T21:56:51+00:00" + "time": "2018-01-26T15:01:00+00:00" }, { "name": "sebastiaanluca/laravel-helpers", @@ -2989,148 +2925,29 @@ ], "time": "2017-11-05T17:39:05+00:00" }, - { - "name": "spatie/fractalistic", - "version": "2.7.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/fractalistic.git", - "reference": "83e208ce1e6061aa75d22c4efdab05ccfb99a849" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/fractalistic/zipball/83e208ce1e6061aa75d22c4efdab05ccfb99a849", - "reference": "83e208ce1e6061aa75d22c4efdab05ccfb99a849", - "shasum": "" - }, - "require": { - "league/fractal": "^0.17.0", - "php": "^7.0" - }, - "require-dev": { - "illuminate/pagination": "~5.3.0|~5.4.0", - "phpunit/phpunit": "^5.7.21" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Fractalistic\\": "src" - } - }, - "notification-url": "http://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "A developer friendly wrapper around Fractal", - "homepage": "https://github.com/spatie/fractalistic", - "keywords": [ - "api", - "fractal", - "fractalistic", - "spatie", - "transform" - ], - "time": "2018-01-15T09:17:52+00:00" - }, - { - "name": "spatie/laravel-fractal", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-fractal.git", - "reference": "f395eb645cd454b209bc628f974ed137d16e03da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-fractal/zipball/f395eb645cd454b209bc628f974ed137d16e03da", - "reference": "f395eb645cd454b209bc628f974ed137d16e03da", - "shasum": "" - }, - "require": { - "illuminate/contracts": "~5.5.0", - "illuminate/support": "~5.5.0", - "php": "^7.0", - "spatie/fractalistic": "^2.5" - }, - "require-dev": { - "orchestra/testbench": "~3.5.0", - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Spatie\\Fractal\\FractalServiceProvider" - ], - "aliases": { - "Fractal": "Spatie\\Fractal\\FractalFacade" - } - } - }, - "autoload": { - "psr-4": { - "Spatie\\Fractal\\": "src" - }, - "files": [ - "src/helpers.php" - ] - }, - "notification-url": "http://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "An easy to use Fractal integration for Laravel applications", - "homepage": "https://github.com/spatie/laravel-fractal", - "keywords": [ - "api", - "fractal", - "laravel", - "laravel-fractal", - "lumen", - "spatie", - "transform" - ], - "time": "2017-11-28T16:33:26+00:00" - }, { "name": "spatie/laravel-pjax", - "version": "1.3.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-pjax.git", - "reference": "30e1509517a6371a5774a29e99e2db204cb7fc5b" + "reference": "5c8d3b147bbdb40ecd794dee3035b4c05734ef35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-pjax/zipball/30e1509517a6371a5774a29e99e2db204cb7fc5b", - "reference": "30e1509517a6371a5774a29e99e2db204cb7fc5b", + "url": "https://api.github.com/repos/spatie/laravel-pjax/zipball/5c8d3b147bbdb40ecd794dee3035b4c05734ef35", + "reference": "5c8d3b147bbdb40ecd794dee3035b4c05734ef35", "shasum": "" }, "require": { "illuminate/http": "^5.1", "illuminate/support": "^5.1", "php": "^5.5.0|^7.0", - "symfony/css-selector": "^2.7|^3.0", - "symfony/dom-crawler": "^2.7|^3.0" + "symfony/css-selector": "^2.7|^3.0|^4.0", + "symfony/dom-crawler": "^2.7|^3.0|^4.0" }, "require-dev": { - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "^4.8.36", "scrutinizer/ocular": "~1.1" }, "type": "library", @@ -3139,7 +2956,7 @@ "Spatie\\Pjax\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", + "notification-url": "http://packagist.org/downloads/", "license": [ "MIT" ], @@ -3158,7 +2975,7 @@ "pjax", "spatie" ], - "time": "2016-02-18T15:16:46+00:00" + "time": "2018-02-06T13:21:42+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -3286,25 +3103,25 @@ }, { "name": "symfony/css-selector", - "version": "v3.4.4", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "e66394bc7610e69279bfdb3ab11b4fe65403f556" + "reference": "f97600434e3141ef3cbb9ea42cf500fba88022b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/e66394bc7610e69279bfdb3ab11b4fe65403f556", - "reference": "e66394bc7610e69279bfdb3ab11b4fe65403f556", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/f97600434e3141ef3cbb9ea42cf500fba88022b7", + "reference": "f97600434e3141ef3cbb9ea42cf500fba88022b7", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3335,7 +3152,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/debug", @@ -3395,24 +3212,24 @@ }, { "name": "symfony/dom-crawler", - "version": "v3.4.4", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a" + "reference": "39b785e1cf28e9f21bb601a5d62c4992a8e8a290" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/09bd97b844b3151fab82f2fdd62db9c464b3910a", - "reference": "09bd97b844b3151fab82f2fdd62db9c464b3910a", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/39b785e1cf28e9f21bb601a5d62c4992a8e8a290", + "reference": "39b785e1cf28e9f21bb601a5d62c4992a8e8a290", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0" + "symfony/css-selector": "~3.4|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3420,7 +3237,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -3447,7 +3264,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" + "time": "2018-01-03T07:38:00+00:00" }, { "name": "symfony/event-dispatcher", @@ -4816,30 +4633,30 @@ "packages-dev": [ { "name": "barryvdh/laravel-ide-helper", - "version": "v2.4.1", + "version": "v2.4.3", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "2b1273c45e2f8df7a625563e2283a17c14f02ae8" + "reference": "5c304db44fba8e9c4aa0c09739e59f7be7736fdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/2b1273c45e2f8df7a625563e2283a17c14f02ae8", - "reference": "2b1273c45e2f8df7a625563e2283a17c14f02ae8", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/5c304db44fba8e9c4aa0c09739e59f7be7736fdd", + "reference": "5c304db44fba8e9c4aa0c09739e59f7be7736fdd", "shasum": "" }, "require": { "barryvdh/reflection-docblock": "^2.0.4", - "illuminate/console": "^5.0,<5.6", - "illuminate/filesystem": "^5.0,<5.6", - "illuminate/support": "^5.0,<5.6", + "illuminate/console": "^5.0,<5.7", + "illuminate/filesystem": "^5.0,<5.7", + "illuminate/support": "^5.0,<5.7", "php": ">=5.4.0", "symfony/class-loader": "^2.3|^3.0" }, "require-dev": { "doctrine/dbal": "~2.3", - "illuminate/config": "^5.0,<5.6", - "illuminate/view": "^5.0,<5.6", + "illuminate/config": "^5.0,<5.7", + "illuminate/view": "^5.0,<5.7", "phpunit/phpunit": "4.*", "scrutinizer/ocular": "~1.1", "squizlabs/php_codesniffer": "~2.3" @@ -4885,7 +4702,7 @@ "phpstorm", "sublime" ], - "time": "2017-07-16T00:24:12+00:00" + "time": "2018-02-08T07:56:07+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -5375,128 +5192,6 @@ ], "time": "2017-10-19T19:58:43+00:00" }, - { - "name": "orchestra/testbench", - "version": "v3.5.2", - "source": { - "type": "git", - "url": "https://github.com/orchestral/testbench.git", - "reference": "a373ba077c60a90ffcaea9eb8ac2d6605db94a04" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench/zipball/a373ba077c60a90ffcaea9eb8ac2d6605db94a04", - "reference": "a373ba077c60a90ffcaea9eb8ac2d6605db94a04", - "shasum": "" - }, - "require": { - "laravel/framework": "~5.5.0", - "orchestra/testbench-core": "~3.5.4", - "php": ">=7.0", - "phpunit/phpunit": "~6.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "orchestra/database": "~3.5.0" - }, - "suggest": { - "orchestra/testbench-browser-kit": "Allow to use legacy BrowserKit for testing (~3.5)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "description": "Laravel Testing Helper for Packages Development", - "homepage": "http://orchestraplatform.com/docs/latest/components/testbench/", - "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" - ], - "time": "2017-10-08T08:01:03+00:00" - }, - { - "name": "orchestra/testbench-core", - "version": "v3.5.6", - "source": { - "type": "git", - "url": "https://github.com/orchestral/testbench-core.git", - "reference": "98664ac917c10f744181ca50796faea264f1efb2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/orchestral/testbench-core/zipball/98664ac917c10f744181ca50796faea264f1efb2", - "reference": "98664ac917c10f744181ca50796faea264f1efb2", - "shasum": "" - }, - "require": { - "fzaninotto/faker": "~1.4", - "php": ">=7.0" - }, - "require-dev": { - "laravel/framework": "~5.5.0", - "mockery/mockery": "~1.0", - "orchestra/database": "~3.5.0", - "phpunit/phpunit": "~6.0" - }, - "suggest": { - "laravel/framework": "Required for testing (~5.5.0).", - "mockery/mockery": "Allow to use Mockery for testing (~1.0).", - "orchestra/database": "Allow to use --realpath migration for testing (~3.5).", - "orchestra/testbench-browser-kit": "Allow to use legacy BrowserKit for testing (~3.5).", - "orchestra/testbench-dusk": "Allow to use Laravel Dusk for testing (~3.5).", - "phpunit/phpunit": "Allow to use PHPUnit for testing (~6.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, - "autoload": { - "psr-4": { - "Orchestra\\Testbench\\": "src/" - } - }, - "notification-url": "http://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mior Muhammad Zaki", - "email": "crynobone@gmail.com", - "homepage": "https://github.com/crynobone" - } - ], - "description": "Testing Helper for Laravel Development", - "homepage": "http://orchestraplatform.com/docs/latest/components/testbench/", - "keywords": [ - "BDD", - "TDD", - "laravel", - "orchestra-platform", - "orchestral", - "testing" - ], - "time": "2018-01-06T15:40:19+00:00" - }, { "name": "phar-io/manifest", "version": "1.0.1", diff --git a/config/app.php b/config/app.php index 356d3c03..72288c99 100755 --- a/config/app.php +++ b/config/app.php @@ -72,7 +72,6 @@ return [ Collective\Html\HtmlServiceProvider::class, Laracasts\Flash\FlashServiceProvider::class, Prettus\Repository\Providers\RepositoryServiceProvider::class, - Spatie\Fractal\FractalServiceProvider::class, SebastiaanLuca\Helpers\Methods\GlobalHelpersServiceProvider::class, SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class, Toin0u\Geotools\GeotoolsServiceProvider::class, @@ -106,7 +105,6 @@ return [ 'File' => Illuminate\Support\Facades\File::class, 'Flash' => Laracasts\Flash\Flash::class, 'Form' => Collective\Html\FormFacade::class, - 'Fractal' => Spatie\Fractal\FractalFacade::class, 'Gate' => Illuminate\Support\Facades\Gate::class, 'Geotools' => Toin0u\Geotools\Facade\Geotools::class, 'Hash' => Illuminate\Support\Facades\Hash::class, diff --git a/config/version.yml b/config/version.yml index 74a923c2..c0996edc 100644 --- a/config/version.yml +++ b/config/version.yml @@ -9,7 +9,7 @@ build: mode: number length: 6 increment_by: 1 - number: 180205-6ab2e4 + number: 180208-48346a git_absorb: git-local git: git-local: 'git rev-parse --verify HEAD' diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 681a4539..1208c3c6 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -22,7 +22,7 @@ class ApiTest extends TestCase { $user = factory(User::class)->create(); - $uri = $this->u('/user'); + $uri = '/api/user'; // Missing auth header $this->get($uri)->assertStatus(401); @@ -73,7 +73,7 @@ class ApiTest extends TestCase $airlines = factory(App\Models\Airline::class, $size)->create(); - $res = $this->get($this->u('/airlines')); + $res = $this->get('/api/airlines'); $body = $res->json(); $this->assertCount($size, $body['data']); diff --git a/tests/TestCase.php b/tests/TestCase.php index feb52ae3..e62aa917 100755 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,7 +6,7 @@ use App\Services\DatabaseService; /** * Class TestCase */ -abstract class TestCase extends Illuminate\Foundation\Testing\TestCase +class TestCase extends Illuminate\Foundation\Testing\TestCase { /** * The base URL to use while testing the application. @@ -25,9 +25,25 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase 'x-api-key' => 'testadminapikey' ]; - public function apiHeaders() + /** + * @throws Exception + */ + public function setUp() { - return self::$auth_headers; + parent::setUp(); + Artisan::call('database:create', ['--reset' => true]); + Artisan::call('migrate:refresh', ['--env' => 'unittest']); + } + + /** + * Creates the application. Required to be implemented + * @return \Illuminate\Foundation\Application + */ + public function createApplication() + { + $app = require __DIR__ . '/../bootstrap/app.php'; + $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); + return $app; } /** @@ -49,45 +65,9 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase } /** - * Return the URL with the URI prefix - * @param $uri - * @return string + * Import data from a YML file + * @param $file */ - public function u($uri) { - return self::$prefix . $uri; - } - - public function __construct($name = null, array $data = [], $dataName = '') { - parent::__construct($name, $data, $dataName); - } - - protected function reset_db() { - Artisan::call('database:create', ['--reset' => true]); - Artisan::call('migrate:refresh', ['--env' => 'unittest']); - } - - public function setUp() { - parent::setUp(); - $this->reset_db(); - } - - /** - * Creates the application. - * - * @return \Illuminate\Foundation\Application - */ - public function createApplication() - { - $app = require __DIR__.'/../bootstrap/app.php'; - $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); - return $app; - } - - public function createRepository($repo_name) { - $app = $this->createApplication(); - return $app->make('App\Repositories\\' . $repo_name); - } - public function addData($file) { $svc = app(DatabaseService::class); @@ -98,11 +78,6 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase } } - public function fillableFields(\Illuminate\Database\Eloquent\Model $model) - { - return $model->fillable; - } - /** * Make sure an object has the list of keys * @param $obj