Skip to content

Updated facade to return correct accessor #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
},
"require-dev": {
"mockery/mockery": "dev-master",
"phpunit/phpunit": "4.8.*"
"phpunit/phpunit": "4.8.*",
"illuminate/support": "^5.1"
},
"autoload": {
"psr-4": {
"Fadion\\Fixerio\\": "src"
}
},
"minimum-stability": "stable"
}
}
7 changes: 5 additions & 2 deletions src/Facades/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
}
18 changes: 18 additions & 0 deletions tests/LaravelIntegrationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

use Fadion\Fixerio\ExchangeServiceProvider;
use Fadion\Fixerio\Facades\Exchange as Facade;

class LaravelIntegrationTest extends \PHPUnit\Framework\TestCase
{
public function testServiceProviderProvidesFacadeAccessor()
{
$provides = (new ExchangeServiceProvider(null))->provides();

$app = array_combine($provides, $provides);

Facade::setFacadeApplication($app);

$this->assertContains(Facade::getFacadeRoot(), $provides);
}
}