Tom Lingham
9 years ago
11 changed files with 182 additions and 49 deletions
-
2.gitattributes
-
5.gitignore
-
17.travis.yml
-
2LICENSE
-
13composer.json
-
14phpunit.xml.dist
-
83src/SearchyServiceProvider.php
-
0tests/.gitkeep
-
26tests/AbstractTestCase.php
-
48tests/Facades/SearchyTest.php
-
21tests/ServiceProviderTest.php
@ -1,6 +1,3 @@ |
|||||
/vendor |
|
||||
composer.phar |
|
||||
composer.lock |
composer.lock |
||||
.DS_Store |
|
||||
.idea |
|
||||
phpunit.xml |
phpunit.xml |
||||
|
vendor |
@ -1,12 +1,21 @@ |
|||||
language: php |
language: php |
||||
|
|
||||
php: |
php: |
||||
|
- 5.5.9 |
||||
- 5.5 |
- 5.5 |
||||
- 5.6 |
- 5.6 |
||||
|
- 7.0 |
||||
- hhvm |
- hhvm |
||||
|
|
||||
before_script: |
|
||||
- composer self-update |
|
||||
- composer install --prefer-source --no-interaction --dev |
|
||||
|
sudo: false |
||||
|
|
||||
script: vendor/bin/phpspec run |
|
||||
|
install: |
||||
|
- travis_retry composer install --no-interaction --prefer-source |
||||
|
|
||||
|
script: |
||||
|
- if [ "$TRAVIS_PHP_VERSION" != "5.5.9" ] && [ "$TRAVIS_PHP_VERSION" != "5.5" ] && [ "$TRAVIS_PHP_VERSION" != "5.6" ]; then vendor/bin/phpunit; fi |
||||
|
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then vendor/bin/phpunit --coverage-clover build/logs/clover.xml; fi |
||||
|
|
||||
|
after_script: |
||||
|
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi |
||||
|
- if [ "$TRAVIS_PHP_VERSION" == "5.5.9" ] || [ "$TRAVIS_PHP_VERSION" == "5.5" ] || [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi |
@ -1,18 +1,28 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
<phpunit backupGlobals="false" |
<phpunit backupGlobals="false" |
||||
backupStaticAttributes="false" |
backupStaticAttributes="false" |
||||
|
beStrictAboutTestsThatDoNotTestAnything="true" |
||||
|
beStrictAboutOutputDuringTests="true" |
||||
bootstrap="vendor/autoload.php" |
bootstrap="vendor/autoload.php" |
||||
colors="true" |
colors="true" |
||||
convertErrorsToExceptions="true" |
convertErrorsToExceptions="true" |
||||
convertNoticesToExceptions="true" |
convertNoticesToExceptions="true" |
||||
convertWarningsToExceptions="true" |
convertWarningsToExceptions="true" |
||||
|
failOnRisky="true" |
||||
|
failOnWarning="true" |
||||
processIsolation="false" |
processIsolation="false" |
||||
|
stopOnError="false" |
||||
stopOnFailure="false" |
stopOnFailure="false" |
||||
syntaxCheck="false" |
|
||||
|
verbose="true" |
||||
> |
> |
||||
<testsuites> |
<testsuites> |
||||
<testsuite name="Laravel Searchy Test Suite"> |
<testsuite name="Laravel Searchy Test Suite"> |
||||
<directory suffix=".php">./tests/</directory> |
|
||||
|
<directory suffix="Test.php">./tests</directory> |
||||
</testsuite> |
</testsuite> |
||||
</testsuites> |
</testsuites> |
||||
|
<filter> |
||||
|
<whitelist processUncoveredFilesFromWhitelist="true"> |
||||
|
<directory suffix=".php">./src</directory> |
||||
|
</whitelist> |
||||
|
</filter> |
||||
</phpunit> |
</phpunit> |
@ -0,0 +1,26 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace TomLingham\Tests\Searchy; |
||||
|
|
||||
|
use GrahamCampbell\TestBench\AbstractPackageTestCase; |
||||
|
use TomLingham\Searchy\SearchyServiceProvider; |
||||
|
|
||||
|
/** |
||||
|
* This is the abstract test case class. |
||||
|
* |
||||
|
* @author Vincent Klaiber <hello@vinkla.com> |
||||
|
*/ |
||||
|
abstract class AbstractTestCase extends AbstractPackageTestCase |
||||
|
{ |
||||
|
/** |
||||
|
* Get the service provider class. |
||||
|
* |
||||
|
* @param \Illuminate\Contracts\Foundation\Application $app |
||||
|
* |
||||
|
* @return string |
||||
|
*/ |
||||
|
protected function getServiceProviderClass($app) |
||||
|
{ |
||||
|
return SearchyServiceProvider::class; |
||||
|
} |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace TomLingham\Tests\Searchy\Facades; |
||||
|
|
||||
|
use GrahamCampbell\TestBenchCore\FacadeTrait; |
||||
|
use TomLingham\Searchy\Facades\Searchy; |
||||
|
use TomLingham\Searchy\SearchBuilder; |
||||
|
use TomLingham\Tests\Searchy\AbstractTestCase; |
||||
|
|
||||
|
/** |
||||
|
* This is the searchy facade test class. |
||||
|
* |
||||
|
* @author Vincent Klaiber <hello@vinkla.com> |
||||
|
*/ |
||||
|
class SearchyTest extends AbstractTestCase |
||||
|
{ |
||||
|
use FacadeTrait; |
||||
|
|
||||
|
/** |
||||
|
* Get the facade accessor. |
||||
|
* |
||||
|
* @return string |
||||
|
*/ |
||||
|
protected function getFacadeAccessor() |
||||
|
{ |
||||
|
return 'searchy'; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Get the facade class. |
||||
|
* |
||||
|
* @return string |
||||
|
*/ |
||||
|
protected function getFacadeClass() |
||||
|
{ |
||||
|
return Searchy::class; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Get the facade root. |
||||
|
* |
||||
|
* @return string |
||||
|
*/ |
||||
|
protected function getFacadeRoot() |
||||
|
{ |
||||
|
return SearchBuilder::class; |
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace TomLingham\Tests\Searchy; |
||||
|
|
||||
|
use GrahamCampbell\TestBenchCore\ServiceProviderTrait; |
||||
|
use TomLingham\Searchy\SearchBuilder; |
||||
|
|
||||
|
/** |
||||
|
* This is the service provider test. |
||||
|
* |
||||
|
* @author Vincent Klaiber <hello@vinkla.com> |
||||
|
*/ |
||||
|
class ServiceProviderTest extends AbstractTestCase |
||||
|
{ |
||||
|
use ServiceProviderTrait; |
||||
|
|
||||
|
public function testSearchBuilderIsInjectable() |
||||
|
{ |
||||
|
$this->assertIsInjectable(SearchBuilder::class); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue