Skip to content

Commit

Permalink
Merge pull request #78 from TeenQuotes/feature/codeception-specific-v…
Browse files Browse the repository at this point in the history
…ersion

Use only Codeception v2.0.13 for tests
  • Loading branch information
AntoineAugusti committed Sep 6, 2015
2 parents aaf59d2 + 0768227 commit 0642862
Show file tree
Hide file tree
Showing 334 changed files with 3,312 additions and 364 deletions.
9 changes: 9 additions & 0 deletions app/TeenQuotes/AdminPanel/AdminPanelServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\AdminPanel;

use Illuminate\Support\ServiceProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\AdminPanel\Composers;

use Config;
Expand Down
11 changes: 10 additions & 1 deletion app/TeenQuotes/AdminPanel/Controllers/QuotesAdminController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\AdminPanel\Controllers;

use App;
Expand Down Expand Up @@ -128,7 +137,7 @@ public function postModerate($id, $type)
}

$approved = $moderation->isApproved() ? Quote::PENDING : Quote::REFUSED;
$quote = $this->quoteRepo->updateApproved($id, $approved);
$quote = $this->quoteRepo->updateApproved($id, $approved);

// Contact the author of the quote
$this->sendMailForQuoteAndModeration($quote, $moderation);
Expand Down
9 changes: 9 additions & 0 deletions app/TeenQuotes/AdminPanel/Helpers/Moderation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\AdminPanel\Helpers;

class Moderation
Expand Down
9 changes: 9 additions & 0 deletions app/TeenQuotes/Api/V1/ApiServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1;

use Illuminate\Support\ServiceProvider;
Expand Down
9 changes: 9 additions & 0 deletions app/TeenQuotes/Api/V1/Controllers/APIGlobalController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use Auth;
Expand Down
23 changes: 16 additions & 7 deletions app/TeenQuotes/Api/V1/Controllers/CommentsController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use App;
Expand All @@ -23,7 +32,7 @@ public function bootstrap()

public function index($quote_id)
{
$page = $this->getPage();
$page = $this->getPage();
$pagesize = $this->getPagesize();

// Get comments
Expand All @@ -39,7 +48,7 @@ public function index($quote_id)
}

// Get the total number of comments for the related quote
$relatedQuote = $this->quoteRepo->getById($quote_id);
$relatedQuote = $this->quoteRepo->getById($quote_id);
$totalComments = $relatedQuote->total_comments;

$data = $this->paginateContent($page, $pagesize, $totalComments, $content, 'comments');
Expand All @@ -49,7 +58,7 @@ public function index($quote_id)

public function getCommentsForUser($user_id)
{
$page = $this->getPage();
$page = $this->getPage();
$pagesize = $this->getPagesize();

$user = $this->userRepo->getById($user_id);
Expand Down Expand Up @@ -93,7 +102,7 @@ public function show($comment_id)

public function store($quote_id, $doValidation = true)
{
$user = $this->retrieveUser();
$user = $this->retrieveUser();
$content = Input::get('content');

if ($doValidation) {
Expand All @@ -106,7 +115,7 @@ public function store($quote_id, $doValidation = true)
if (!$quote->isPublished()) {
return Response::json([
'status' => 'wrong_quote_id',
'error' => 'The quote should be published.',
'error' => 'The quote should be published.',
], 400);
}

Expand All @@ -118,7 +127,7 @@ public function store($quote_id, $doValidation = true)

public function update($id)
{
$user = $this->retrieveUser();
$user = $this->retrieveUser();
$content = Input::get('content');
$comment = $this->commentRepo->findById($id);

Expand Down Expand Up @@ -146,7 +155,7 @@ public function update($id)

public function destroy($id)
{
$user = $this->retrieveUser();
$user = $this->retrieveUser();
$comment = $this->commentRepo->findById($id);

// Handle not found
Expand Down
9 changes: 9 additions & 0 deletions app/TeenQuotes/Api/V1/Controllers/CountriesController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use TeenQuotes\Http\Facades\Response;
Expand Down
21 changes: 15 additions & 6 deletions app/TeenQuotes/Api/V1/Controllers/PasswordController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use Input;
Expand All @@ -18,15 +27,15 @@ public function postRemind()
switch ($response) {
case Password::INVALID_USER:
$status = 400;
$data = [
$data = [
'status' => 'wrong_user',
'error' => "The email address doesn't match a user.",
];
break;

case Password::REMINDER_SENT:
$status = 200;
$data = [
$data = [
'status' => 'reminder_sent',
'success' => 'An email was sent to the user.',
];
Expand Down Expand Up @@ -55,31 +64,31 @@ public function postReset()
switch ($response) {
case Password::INVALID_PASSWORD:
$status = 400;
$data = [
$data = [
'status' => 'wrong_password',
'error' => 'The password is wrong.',
];
break;

case Password::INVALID_TOKEN:
$status = 400;
$data = [
$data = [
'status' => 'wrong_token',
'error' => 'The reset token is invalid.',
];
break;

case Password::INVALID_USER:
$status = 400;
$data = [
$data = [
'status' => 'wrong_user',
'error' => "The email address doesn't match a user.",
];
break;

case Password::PASSWORD_RESET:
$status = 200;
$data = [
$data = [
'status' => 'password_reset',
'success' => 'The new password has been set.',
];
Expand Down
17 changes: 13 additions & 4 deletions app/TeenQuotes/Api/V1/Controllers/QuotesController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use App;
Expand Down Expand Up @@ -102,7 +111,7 @@ public function random()

public function getTopFavoritedQuotes()
{
$ids = $this->favQuoteRepo->getTopQuotes($this->getPage(), $this->getPagesize());
$ids = $this->favQuoteRepo->getTopQuotes($this->getPage(), $this->getPagesize());
$quotes = $this->quoteRepo->getForIds($ids, 1, count($ids));

$total = $this->quoteRepo->nbQuotesWithFavorites();
Expand All @@ -112,7 +121,7 @@ public function getTopFavoritedQuotes()

public function getTopCommentedQuotes()
{
$ids = $this->commentRepo->getTopQuotes($this->getPage(), $this->getPagesize());
$ids = $this->commentRepo->getTopQuotes($this->getPage(), $this->getPagesize());
$quotes = $this->quoteRepo->getForIds($ids, 1, count($ids));

$total = $this->quoteRepo->nbQuotesWithComments();
Expand Down Expand Up @@ -147,8 +156,8 @@ public function getQuotesForTag($tag_name)

public function store($doValidation = true)
{
$user = $this->retrieveUser();
$content = Input::get('content');
$user = $this->retrieveUser();
$content = Input::get('content');
$quotesSubmittedToday = $this->quoteRepo->submittedTodayForUser($user);

if ($doValidation) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use App;
Expand Down
13 changes: 11 additions & 2 deletions app/TeenQuotes/Api/V1/Controllers/SearchController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use Config;
Expand All @@ -13,12 +22,12 @@ class SearchController extends APIGlobalController implements PaginatedContentIn
{
public function getSearch($query)
{
$page = $this->getPage();
$page = $this->getPage();
$pagesize = $this->getPagesize();

// Get content
list($quotes, $totalQuotes) = $this->getTotalQuotesAndQuotesForQuery($page, $pagesize, $query);
list($users, $totalUsers) = $this->getTotalUsersAndUsersForQuery($page, $pagesize, $query);
list($users, $totalUsers) = $this->getTotalUsersAndUsersForQuery($page, $pagesize, $query);

// Handle no results
if ($totalQuotes == 0 and $totalUsers == 0) {
Expand Down
11 changes: 10 additions & 1 deletion app/TeenQuotes/Api/V1/Controllers/StoriesController.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* This file is part of the Teen Quotes website.
*
* (c) Antoine Augusti <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace TeenQuotes\Api\V1\Controllers;

use App;
Expand All @@ -23,7 +32,7 @@ protected function bootstrap()

public function index()
{
$page = $this->getPage();
$page = $this->getPage();
$pagesize = $this->getPagesize();

// Get stories
Expand Down
Loading

0 comments on commit 0642862

Please sign in to comment.