Skip to content

Commit

Permalink
Run cs-fixer on tests.
Browse files Browse the repository at this point in the history
Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Mar 10, 2015
1 parent 53645d1 commit 6a8d769
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions tests/DecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DecoratorTest extends \PHPUnit_Framework_TestCase
*/
public function testAddAndUsingMacros()
{
$stub = new Decorator;
$stub = new Decorator();

$stub->macro('foo', function () {
return 'foo';
Expand All @@ -27,6 +27,6 @@ public function testAddAndUsingMacros()
*/
public function testCallingUndefinedMacrosThrowsException()
{
with(new Decorator)->foobar();
with(new Decorator())->foobar();
}
}
6 changes: 3 additions & 3 deletions tests/FileViewFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function tearDown()
public function testFindNamedPathViewMethod()
{
$files = $this->files;
$stub = new FileViewFinder($files, array('/path/theme/views', '/path/app/views'), array('php'));
$stub = new FileViewFinder($files, ['/path/theme/views', '/path/app/views'], ['php']);

$files->shouldReceive('exists')->once()->with('/path/theme/views/packages/foo/bar/hello.php')->andReturn(false)
->shouldReceive('exists')->once()->with('/path/app/views/packages/foo/bar/hello.php')->andReturn(false)
Expand All @@ -55,13 +55,13 @@ public function testFindNamedPathViewMethod()
public function testSetPathsMethod()
{
$files = $this->files;
$stub = new FileViewFinder($files, array('/path/theme/views', '/path/app/views'), array('php'));
$stub = new FileViewFinder($files, ['/path/theme/views', '/path/app/views'], ['php']);

$refl = new \ReflectionObject($stub);
$paths = $refl->getProperty('paths');
$paths->setAccessible(true);

$expected = array('/path/orchestra/views');
$expected = ['/path/orchestra/views'];
$stub->setPaths($expected);

$this->assertEquals($expected, $paths->getValue($stub));
Expand Down
10 changes: 5 additions & 5 deletions tests/Theme/FinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FinderTest extends \PHPUnit_Framework_TestCase
*/
public function setUp()
{
$this->app = new Container;
$this->app = new Container();
}

/**
Expand All @@ -37,15 +37,15 @@ public function tearDown()
*/
public function testDetectMethod()
{
$app = $this->app;
$app = $this->app;
$app['path.public'] = '/var/orchestra/public/';
$app['files'] = $file = m::mock('\Illuminate\Filesystem\Filesystem');
$app['files'] = $file = m::mock('\Illuminate\Filesystem\Filesystem');

$file->shouldReceive('directories')->once()
->with('/var/orchestra/public/themes/')->andReturn(array(
->with('/var/orchestra/public/themes/')->andReturn([
'/var/orchestra/public/themes/a',
'/var/orchestra/public/themes/b',
))
])
->shouldReceive('exists')->once()
->with('/var/orchestra/public/themes/a/theme.json')->andReturn(true)
->shouldReceive('exists')->once()
Expand Down
12 changes: 6 additions & 6 deletions tests/Theme/ThemeManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class ThemeManagerTest extends \PHPUnit_Framework_TestCase
*/
public function setUp()
{
$this->app = new Container;
$this->app['request'] = $request = m::mock('\Illuminate\Http\Request');
$this->app['events'] = m::mock('\Illuminate\Contracts\Events\Dispatcher');
$this->app['files'] = m::mock('\Illuminate\Filesystem\Filesystem');
$this->app['path.base'] = '/var/orchestra';
$this->app = new Container();
$this->app['request'] = $request = m::mock('\Illuminate\Http\Request');
$this->app['events'] = m::mock('\Illuminate\Contracts\Events\Dispatcher');
$this->app['files'] = m::mock('\Illuminate\Filesystem\Filesystem');
$this->app['path.base'] = '/var/orchestra';
$this->app['path.public'] = '/var/orchestra/public';

$request->shouldReceive('root')->andReturn('http://localhost/');
Expand Down Expand Up @@ -56,7 +56,7 @@ public function testConstructMethod()
*/
public function testDetectMethod()
{
$app = $this->app;
$app = $this->app;
$app['orchestra.theme.finder'] = $finder = m::mock('\Orchestra\View\Theme\Finder');

$finder->shouldReceive('detect')->once()->andReturn('foo');
Expand Down
34 changes: 17 additions & 17 deletions tests/Theme/ThemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ class ThemeTest extends \PHPUnit_Framework_TestCase
*/
public function setUp()
{
$this->app = new Container;
$this->app = new Container();

$this->app['path.public'] = '/var/orchestra/public';
$this->app['path.base'] = '/var/orchestra';
$this->app['request'] = $request = m::mock('Request');
$this->app['path.base'] = '/var/orchestra';
$this->app['request'] = $request = m::mock('Request');

$request->shouldReceive('root')->andReturn('http://localhost/');
}
Expand All @@ -45,21 +45,21 @@ public function tearDown()
*/
public function testGetterAndSetterForTheme()
{
$app = $this->app;
$app = $this->app;
$app['view.finder'] = $finder = m::mock('\Orchestra\View\FileViewFinder');
$app['files'] = $files = m::mock('\Illuminate\Filesystem\Filesystem');
$app['events'] = $events = m::mock('\Illuminate\Contracts\Events\Dispatcher');
$app['files'] = $files = m::mock('\Illuminate\Filesystem\Filesystem');
$app['events'] = $events = m::mock('\Illuminate\Contracts\Events\Dispatcher');

$defaultPath = '/var/orchestra/resources/views';
$themePath = '/var/orchestra/public/themes';
$defaultPath = '/var/orchestra/resources/views';
$themePath = '/var/orchestra/public/themes';
$resourcePath = '/var/orchestra/resources/themes';

$stub = new Theme($app, $events, $files);

$finder->shouldReceive('getPaths')->times(3)->andReturn(array($defaultPath))
->shouldReceive('setPaths')->once()->with(array($defaultPath))->andReturnNull()
->shouldReceive('setPaths')->once() ->with(array("{$resourcePath}/foo", "{$themePath}/foo", $defaultPath))->andReturnNull()
->shouldReceive('setPaths')->once() ->with(array("{$resourcePath}/default", "{$themePath}/default", $defaultPath))->andReturnNull();
$finder->shouldReceive('getPaths')->times(3)->andReturn([$defaultPath])
->shouldReceive('setPaths')->once()->with([$defaultPath])->andReturnNull()
->shouldReceive('setPaths')->once()->with(["{$resourcePath}/foo", "{$themePath}/foo", $defaultPath])->andReturnNull()
->shouldReceive('setPaths')->once()->with(["{$resourcePath}/default", "{$themePath}/default", $defaultPath])->andReturnNull();
$files->shouldReceive('isDirectory')->once()->with("{$themePath}/foo")->andReturn(true)
->shouldReceive('isDirectory')->once()->with("{$resourcePath}/foo")->andReturn(true)
->shouldReceive('isDirectory')->once()->with("{$themePath}/default")->andReturn(true)
Expand All @@ -69,7 +69,7 @@ public function testGetterAndSetterForTheme()
->andReturn('{"autoload":["start.php"]}')
->shouldReceive('requireOnce')->once()->with('/var/orchestra/public/themes/default/start.php')
->andReturnNull();
$events->shouldReceive('fire')->twice()->with('orchestra.theme.resolving', array($stub, $app))->andReturnNull()
$events->shouldReceive('fire')->twice()->with('orchestra.theme.resolving', [$stub, $app])->andReturnNull()
->shouldReceive('fire')->once()->with('orchestra.theme.set: foo')->andReturnNull()
->shouldReceive('fire')->once()->with('orchestra.theme.unset: foo')->andReturnNull()
->shouldReceive('fire')->once()->with('orchestra.theme.set: default')->andReturnNull()
Expand Down Expand Up @@ -104,12 +104,12 @@ public function testGetterAndSetterForTheme()
*/
public function testBootMethodWhenManifestIsNotAvailable()
{
$app = $this->app;
$app = $this->app;
$app['view.finder'] = $finder = m::mock('\Orchestra\View\FileViewFinder');
$app['events'] = $events = m::mock('\Illuminate\Contracts\Events\Dispatcher');
$app['files'] = $files = m::mock('\Illuminate\Filesystem\Filesystem');
$app['events'] = $events = m::mock('\Illuminate\Contracts\Events\Dispatcher');
$app['files'] = $files = m::mock('\Illuminate\Filesystem\Filesystem');

$themePath = '/var/orchestra/public/themes';
$themePath = '/var/orchestra/public/themes';
$resourcePath = '/var/orchestra/resources/themes';

$stub = new Theme($app, $events, $files);
Expand Down

0 comments on commit 6a8d769

Please sign in to comment.