Skip to content

Commit 43ef8a9

Browse files
committed
Modified composer.json file for auto loading
1 parent 6723fec commit 43ef8a9

File tree

2 files changed

+64
-3
lines changed

2 files changed

+64
-3
lines changed

composer.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,34 @@
1111
],
1212
"minimum-stability": "dev",
1313
"require": {
14-
"php": ">=5.5.9",
15-
"illuminate/support": "~5.0"
14+
"php" : "^7.1",
15+
"illuminate/config": "~5.5.0|~5.6.0|~5.7.0",
16+
"illuminate/database": "~5.5.0|~5.6.0|~5.7.0",
17+
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0"
18+
},
19+
"require-dev": {
20+
"phpunit/phpunit": "^6.3|^7.0",
21+
"orchestra/testbench": "~3.5.0|~3.6.0"
1622
},
1723
"autoload": {
1824
"psr-4": {
1925
"CodebyRay\\ReviewRateable\\": "src/"
2026
}
2127
},
28+
"autoload-dev": {
29+
"psr-4": {
30+
"CodebyRay\\ReviewRateable\\Test\\": "tests"
31+
}
32+
},
2233
"extra": {
2334
"laravel": {
2435
"providers": [
25-
"Codebyray\\ReviewRateable\\ReviewRateableServiceProvider"
36+
"CodebyRay\\ReviewRateable\\ReviewRateableServiceProvider"
2637
]
2738
}
39+
},
40+
"scripts": {
41+
"test": "vendor/bin/phpunit",
42+
"test:windows": "vendor\\bin\\phpunit"
2843
}
2944
}

tests/TestCase.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
namespace CodebyRay\ReviewRateable\Test;
4+
5+
use CodebyRay\ReviewRateable\ReviewRateableServiceProvider;
6+
use Orchestra\Testbench\TestCase as Orchestra;
7+
8+
abstract class TestCase extends Orchestra
9+
{
10+
11+
/**
12+
* Setup the test environment.
13+
*/
14+
public function setUp()
15+
{
16+
parent::setUp();
17+
}
18+
19+
/**
20+
* add the package provider
21+
*
22+
* @param $app
23+
* @return array
24+
*/
25+
protected function getPackageProviders($app)
26+
{
27+
return [ReviewRateableServiceProvider::class];
28+
}
29+
30+
/**
31+
* Define environment setup.
32+
*
33+
* @param \Illuminate\Foundation\Application $app
34+
* @return void
35+
*/
36+
protected function getEnvironmentSetUp($app)
37+
{
38+
// Setup default database to use sqlite :memory:
39+
$app['config']->set('database.default', 'testing');
40+
$app['config']->set('database.connections.testing', [
41+
'driver' => 'sqlite',
42+
'database' => ':memory:',
43+
'prefix' => '',
44+
]);
45+
}
46+
}

0 commit comments

Comments
 (0)