Skip to content

Commit 15ea028

Browse files
committed
Remove the ability to specify the driver to use rollout in favour of always using cache
1 parent 9f2d73e commit 15ea028

File tree

3 files changed

+2
-74
lines changed

3 files changed

+2
-74
lines changed

config/rollout.php

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/ServiceProvider.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Jaspaul\LaravelRollout;
44

5+
use Jaspaul\LaravelRollout\Drivers\Cache;
56
use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
67

78
class ServiceProvider extends IlluminateServiceProvider
@@ -13,10 +14,5 @@ class ServiceProvider extends IlluminateServiceProvider
1314
*/
1415
public function register()
1516
{
16-
if ($this->app->runningInConsole()) {
17-
$this->publishes([
18-
__DIR__ . '/../config/rollout.php' => $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'rollout.php'
19-
]);
20-
}
2117
}
2218
}

tests/ServiceProviderTest.php

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@ class ServiceProviderTest extends TestCase
1818
function setup_service_provider()
1919
{
2020
$this->container = Mockery::mock(Container::class);
21-
$this->serviceProvider = new ResettableServiceProvider($this->container);
22-
}
23-
24-
/**
25-
* @after
26-
*/
27-
function reset_publish_list()
28-
{
29-
ResettableServiceProvider::$publishes = [];
21+
$this->serviceProvider = new ServiceProvider($this->container);
3022
}
3123

3224
/**
@@ -37,46 +29,4 @@ function ensure_a_service_provider_can_be_constructed()
3729
$this->assertInstanceOf(ServiceProvider::class, $this->serviceProvider);
3830
$this->assertInstanceOf(IlluminateServiceProvider::class, $this->serviceProvider);
3931
}
40-
41-
/**
42-
* @test
43-
*/
44-
function when_running_in_the_console_it_adds_its_configuration_to_the_paths_to_publish()
45-
{
46-
$this->container->shouldReceive('runningInConsole')
47-
->andReturn(true);
48-
$this->container->shouldReceive('make')
49-
->with('path.config')
50-
->andReturn('/this/is/a/path');
51-
$this->serviceProvider->register();
52-
53-
$paths = ResettableServiceProvider::pathsToPublish();
54-
55-
$this->assertNotEmpty($paths);
56-
$this->assertEquals(1, count($paths));
57-
}
58-
59-
/**
60-
* @test
61-
*/
62-
function when_running_outside_of_the_console_its_configuration_is_not_added_to_the_paths_to_publish()
63-
{
64-
$this->container->shouldReceive('runningInConsole')
65-
->andReturn(false);
66-
$this->serviceProvider->register();
67-
68-
$paths = ResettableServiceProvider::pathsToPublish();
69-
70-
$this->assertEmpty($paths);
71-
}
72-
}
73-
74-
class ResettableServiceProvider extends ServiceProvider
75-
{
76-
/**
77-
* The paths that should be published.
78-
*
79-
* @var array
80-
*/
81-
public static $publishes = [];
8232
}

0 commit comments

Comments
 (0)