Applied fixes from StyleCI

This commit is contained in:
Toby Zerner
2016-02-25 22:09:39 -05:00
committed by StyleCI Bot
parent 83c22d73a4
commit a6cf10f854
96 changed files with 240 additions and 245 deletions

View File

@ -1,4 +1,14 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\Flarum\Core\Settings;
use Flarum\Settings\DatabaseSettingsRepository;
@ -16,17 +26,17 @@ class DatabaseSettingsRepositoryTest extends TestCase
$this->connection = m::mock(ConnectionInterface::class);
$this->repository = new DatabaseSettingsRepository($this->connection);
}
public function test_requesting_an_existing_setting_should_return_its_value()
{
$this->connection->shouldReceive("table->where->value")->andReturn('value');
$this->connection->shouldReceive('table->where->value')->andReturn('value');
$this->assertEquals('value', $this->repository->get('key'));
}
public function test_non_existent_setting_values_should_return_null()
{
$this->connection->shouldReceive("table->where->value")->andReturn(null);
$this->connection->shouldReceive('table->where->value')->andReturn(null);
$this->assertEquals('default', $this->repository->get('key', 'default'));
}

View File

@ -1,4 +1,14 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\Flarum\Core\Settings;
use Flarum\Settings\MemoryCacheSettingsRepository;
@ -16,7 +26,7 @@ class MemoryCacheSettingsRepositoryTest extends TestCase
$this->baseRepository = m::mock(SettingsRepositoryInterface::class);
$this->repository = new MemoryCacheSettingsRepository($this->baseRepository);
}
public function test_it_should_return_all_settings_when_not_cached()
{
$this->baseRepository->shouldReceive('all')->once()->andReturn(['key' => 'value']);
@ -32,7 +42,7 @@ class MemoryCacheSettingsRepositoryTest extends TestCase
$this->assertEquals('value2', $this->repository->get('key2'));
$this->assertEquals('value2', $this->repository->get('key2')); // Assert twice to ensure we hit the cache
}
public function test_it_should_set_a_key_value_pair()
{
$this->baseRepository->shouldReceive('set')->once();

View File

@ -1,4 +1,14 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\Test;
use Mockery;