Fixed up code styles as per review by juliushaertl
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
@@ -57,11 +57,11 @@ class DefaultBoardService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function checkFirstRun($userId, $appName) {
|
public function checkFirstRun($userId, $appName) {
|
||||||
$firstRun = $this->config->getUserValue($userId,$appName,'firstRun','yes');
|
$firstRun = $this->config->getUserValue($userId, $appName, 'firstRun', 'yes');
|
||||||
$userBoards = $this->boardMapper->findAllByUser($userId);
|
$userBoards = $this->boardMapper->findAllByUser($userId);
|
||||||
|
|
||||||
if ($firstRun === 'yes' && count($userBoards) === 0) {
|
if ($firstRun === 'yes' && count($userBoards) === 0) {
|
||||||
$this->config->setUserValue($userId,$appName,'firstRun','no');
|
$this->config->setUserValue($userId, $appName, 'firstRun', 'no');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,11 +66,7 @@ class DefaultBoardServiceTest extends TestCase {
|
|||||||
$this->stackService = $this->createMock(StackService::class);
|
$this->stackService = $this->createMock(StackService::class);
|
||||||
$this->cardService = $this->createMock(CardService::class);
|
$this->cardService = $this->createMock(CardService::class);
|
||||||
$this->config = $this->createMock(IConfig::class);
|
$this->config = $this->createMock(IConfig::class);
|
||||||
|
$this->l10n = $this->createMock(IL10N::class);
|
||||||
$this->l10n = $this->request = $this->getMockBuilder(
|
|
||||||
'\OCP\IL10n')
|
|
||||||
->disableOriginalConstructor()
|
|
||||||
->getMock();
|
|
||||||
|
|
||||||
$this->service = new DefaultBoardService(
|
$this->service = new DefaultBoardService(
|
||||||
$this->l10n,
|
$this->l10n,
|
||||||
@@ -83,7 +79,7 @@ class DefaultBoardServiceTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testCheckFirstRunCaseTrue() {
|
public function testCheckFirstRunCaseTrue() {
|
||||||
$appName = "Deck";
|
$appName = 'deck';
|
||||||
$userBoards = [];
|
$userBoards = [];
|
||||||
|
|
||||||
$this->config->expects($this->once())
|
$this->config->expects($this->once())
|
||||||
@@ -102,7 +98,7 @@ class DefaultBoardServiceTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testCheckFirstRunCaseFalse() {
|
public function testCheckFirstRunCaseFalse() {
|
||||||
$appName = "deck";
|
$appName = 'deck';
|
||||||
$board = new Board();
|
$board = new Board();
|
||||||
$board->setTitle('Personal');
|
$board->setTitle('Personal');
|
||||||
$board->setOwner($this->userId);
|
$board->setOwner($this->userId);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class PageControllerTest extends \Test\TestCase {
|
|||||||
public function testIndexOnFirstRun() {
|
public function testIndexOnFirstRun() {
|
||||||
|
|
||||||
$board = new Board();
|
$board = new Board();
|
||||||
$board->setTitle("Personal");
|
$board->setTitle('Personal');
|
||||||
$board->setOwner($this->userId);
|
$board->setOwner($this->userId);
|
||||||
$board->setColor('000000');
|
$board->setColor('000000');
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class PageControllerTest extends \Test\TestCase {
|
|||||||
|
|
||||||
public function testIndexOnSecondRun() {
|
public function testIndexOnSecondRun() {
|
||||||
|
|
||||||
$this->config->setUserValue($this->userId,'deck','firstRun','no');
|
$this->config->setUserValue($this->userId, 'deck', 'firstRun', 'no');
|
||||||
|
|
||||||
$this->defaultBoardService->expects($this->once())
|
$this->defaultBoardService->expects($this->once())
|
||||||
->method('checkFirstRun')
|
->method('checkFirstRun')
|
||||||
|
|||||||
Reference in New Issue
Block a user