@@ -45,14 +45,14 @@ |
||
| 45 | 45 | |
| 46 | 46 | protected function getEnvironmentSetUp($app) |
| 47 | 47 | { |
| 48 | - $app['path.base'] = __DIR__ . '/..'; |
|
| 49 | - $app['config']->set('database.default', 'sqlite'); |
|
| 50 | - $app['config']->set('database.connections.sqlite', array( |
|
| 48 | + $app[ 'path.base' ] = __DIR__ . '/..'; |
|
| 49 | + $app[ 'config' ]->set('database.default', 'sqlite'); |
|
| 50 | + $app[ 'config' ]->set('database.connections.sqlite', array( |
|
| 51 | 51 | 'driver' => 'sqlite', |
| 52 | 52 | 'database' => ':memory:', |
| 53 | 53 | 'prefix' => '', |
| 54 | 54 | )); |
| 55 | - $app['config']->set('translatable.locales', ['en', 'fr']); |
|
| 55 | + $app[ 'config' ]->set('translatable.locales', [ 'en', 'fr' ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | private function resetDatabase() |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** @test */ |
| 10 | 10 | public function it_creates_blocks() |
| 11 | 11 | { |
| 12 | - $block = $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en'], 'fr' => ['body' => 'lorem fr']]); |
|
| 12 | + $block = $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en' ], 'fr' => [ 'body' => 'lorem fr' ] ]); |
|
| 13 | 13 | $blocks = $this->block->all(); |
| 14 | 14 | |
| 15 | 15 | $this->assertCount(1, $blocks); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** @test */ |
| 39 | 39 | public function it_gets_block_by_name() |
| 40 | 40 | { |
| 41 | - $this->block->create(['name' => 'testblock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => true]]); |
|
| 41 | + $this->block->create([ 'name' => 'testblock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => true ] ]); |
|
| 42 | 42 | $this->createRandomBlock(true, true); |
| 43 | 43 | $this->createRandomBlock(true, true); |
| 44 | 44 | $this->createRandomBlock(true, true); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | /** @test */ |
| 52 | 52 | public function it_gets_block_by_name_if_online() |
| 53 | 53 | { |
| 54 | - $this->block->create(['name' => 'testBlock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]); |
|
| 54 | + $this->block->create([ 'name' => 'testBlock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]); |
|
| 55 | 55 | $this->createRandomBlock(true, true); |
| 56 | 56 | $this->createRandomBlock(true, true); |
| 57 | 57 | $this->createRandomBlock(true, true); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** @test */ |
| 69 | 69 | public function it_gets_block_by_facade() |
| 70 | 70 | { |
| 71 | - $this->block->create(['name' => 'testblock', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]); |
|
| 71 | + $this->block->create([ 'name' => 'testblock', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]); |
|
| 72 | 72 | $this->createRandomBlock(true, true); |
| 73 | 73 | $this->createRandomBlock(true, true); |
| 74 | 74 | |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | /** @test */ |
| 81 | 81 | public function it_slugifies_the_name_property() |
| 82 | 82 | { |
| 83 | - $block = $this->block->create(['name' => 'test block', 'en' => ['body' => 'lorem en', 'online' => true], 'fr' => ['body' => 'lorem fr', 'online' => false]]); |
|
| 83 | + $block = $this->block->create([ 'name' => 'test block', 'en' => [ 'body' => 'lorem en', 'online' => true ], 'fr' => [ 'body' => 'lorem fr', 'online' => false ] ]); |
|
| 84 | 84 | |
| 85 | 85 | $this->assertEquals('test-block', $block->name); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | public function it_makes_name_unique() |
| 89 | 89 | { |
| 90 | - $this->block->create(['name' => 'test block']); |
|
| 91 | - $block = $this->block->create(['name' => 'test block']); |
|
| 90 | + $this->block->create([ 'name' => 'test block' ]); |
|
| 91 | + $block = $this->block->create([ 'name' => 'test block' ]); |
|
| 92 | 92 | |
| 93 | 93 | $this->assertEquals('test-block-1', $block->name); |
| 94 | 94 | } |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | /** @test */ |
| 97 | 97 | public function it_increments_name_if_not_unique() |
| 98 | 98 | { |
| 99 | - $this->block->create(['name' => 'test block']); |
|
| 100 | - $this->block->create(['name' => 'test block']); |
|
| 101 | - $block1 = $this->block->create(['name' => 'test block']); |
|
| 102 | - $block2 = $this->block->create(['name' => 'test block']); |
|
| 99 | + $this->block->create([ 'name' => 'test block' ]); |
|
| 100 | + $this->block->create([ 'name' => 'test block' ]); |
|
| 101 | + $block1 = $this->block->create([ 'name' => 'test block' ]); |
|
| 102 | + $block2 = $this->block->create([ 'name' => 'test block' ]); |
|
| 103 | 103 | |
| 104 | 104 | $this->assertEquals('test-block-2', $block1->name); |
| 105 | 105 | $this->assertEquals('test-block-3', $block2->name); |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | /** @test */ |
| 109 | 109 | public function it_updates_block_without_name_change() |
| 110 | 110 | { |
| 111 | - $block = $this->block->create(['name' => 'test block']); |
|
| 112 | - $this->block->update($block, ['name' => 'test-block']); |
|
| 111 | + $block = $this->block->create([ 'name' => 'test block' ]); |
|
| 112 | + $this->block->update($block, [ 'name' => 'test-block' ]); |
|
| 113 | 113 | |
| 114 | 114 | $this->assertEquals($block->name, 'test-block'); |
| 115 | 115 | } |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | /** @test */ |
| 118 | 118 | public function it_updates_block_with_name_change() |
| 119 | 119 | { |
| 120 | - $block = $this->block->create(['name' => 'test block']); |
|
| 121 | - $this->block->update($block, ['name' => 'my awesome block']); |
|
| 120 | + $block = $this->block->create([ 'name' => 'test block' ]); |
|
| 121 | + $this->block->update($block, [ 'name' => 'my awesome block' ]); |
|
| 122 | 122 | |
| 123 | 123 | $this->assertEquals($block->name, 'my-awesome-block'); |
| 124 | 124 | } |
@@ -32,6 +32,6 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function messages() |
| 34 | 34 | { |
| 35 | - return []; |
|
| 35 | + return [ ]; |
|
| 36 | 36 | } |
| 37 | 37 | } |