-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 from TeenQuotes/feature/codeception-specific-v…
…ersion Use only Codeception v2.0.13 for tests
- Loading branch information
Showing
334 changed files
with
3,312 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
9 changes: 9 additions & 0 deletions
9
app/TeenQuotes/AdminPanel/Composers/ModerationIndexComposer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
@@ -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); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
@@ -23,7 +32,7 @@ public function bootstrap() | |
|
||
public function index($quote_id) | ||
{ | ||
$page = $this->getPage(); | ||
$page = $this->getPage(); | ||
$pagesize = $this->getPagesize(); | ||
|
||
// Get comments | ||
|
@@ -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'); | ||
|
@@ -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); | ||
|
@@ -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) { | ||
|
@@ -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); | ||
} | ||
|
||
|
@@ -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); | ||
|
||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
@@ -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.', | ||
]; | ||
|
@@ -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.', | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
@@ -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(); | ||
|
@@ -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(); | ||
|
@@ -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) { | ||
|
9 changes: 9 additions & 0 deletions
9
app/TeenQuotes/Api/V1/Controllers/QuotesFavoriteController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
@@ -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) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
@@ -23,7 +32,7 @@ protected function bootstrap() | |
|
||
public function index() | ||
{ | ||
$page = $this->getPage(); | ||
$page = $this->getPage(); | ||
$pagesize = $this->getPagesize(); | ||
|
||
// Get stories | ||
|
Oops, something went wrong.