From fba0f2a0a7a5c1f326ad8ed59754228d52799351 Mon Sep 17 00:00:00 2001 From: Cody Mann Date: Thu, 7 Jun 2018 12:47:59 -0500 Subject: [PATCH] Updated facade to return correct accessor Laravel facades expect that the facade accessor is "provided" by one of the service providers. Tests have been added to ensure that the service provider will always provide the correct accessor. --- composer.json | 5 +++-- src/Facades/Exchange.php | 7 +++++-- tests/LaravelIntegrationTest.php | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 tests/LaravelIntegrationTest.php diff --git a/composer.json b/composer.json index f424716..d4c3260 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ }, "require-dev": { "mockery/mockery": "dev-master", - "phpunit/phpunit": "4.8.*" + "phpunit/phpunit": "4.8.*", + "illuminate/support": "^5.1" }, "autoload": { "psr-4": { @@ -24,4 +25,4 @@ } }, "minimum-stability": "stable" -} \ No newline at end of file +} diff --git a/src/Facades/Exchange.php b/src/Facades/Exchange.php index a60c61c..50f5f93 100644 --- a/src/Facades/Exchange.php +++ b/src/Facades/Exchange.php @@ -14,6 +14,9 @@ class Exchange extends Facade * * @return string */ - protected static function getFacadeAccessor() { return 'exchange'; } + protected static function getFacadeAccessor() + { + return \Fadion\Fixerio\Exchange::class; + } -} \ No newline at end of file +} diff --git a/tests/LaravelIntegrationTest.php b/tests/LaravelIntegrationTest.php new file mode 100644 index 0000000..8dc064f --- /dev/null +++ b/tests/LaravelIntegrationTest.php @@ -0,0 +1,18 @@ +provides(); + + $app = array_combine($provides, $provides); + + Facade::setFacadeApplication($app); + + $this->assertContains(Facade::getFacadeRoot(), $provides); + } +}