Skip to content
Snippets Groups Projects
Commit afd7880d authored by onny's avatar onny
Browse files

fix tests

parent 46113a54
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ class EpisodeController extends Controller {
$list = $this->fyydapi->queryEpisode($episode_id);
foreach($data as $localEpisode) {
if ($localEpisode->getId() == $list['data']['id']) {
if ($localEpisode->getId() === $list['data']['id']) {
$list['data']['lastplayed'] = $localEpisode->getLastplayed();
$list['data']['playtime'] = $localEpisode->getPlaytime();
}
......@@ -85,7 +85,7 @@ class EpisodeController extends Controller {
foreach($list['data']['episodes'] as $key=>$fyydEpisode) {
foreach($data as $localEpisode) {
if ($localEpisode->getId() == $fyydEpisode['id']) {
if ($localEpisode->getId() === $fyydEpisode['id']) {
$list['data']['episodes'][$key]['lastplayed'] = $localEpisode->getLastplayed();
$list['data']['episodes'][$key]['playtime'] = $localEpisode->getPlaytime();
}
......@@ -97,7 +97,7 @@ class EpisodeController extends Controller {
$data = array_slice($data, $page * $count, $count);
if (count($data) == $count) {
if (count($data) === $count) {
$nextPage = $page + 1;
} else {
$nextPage = null;
......
......@@ -67,7 +67,7 @@ class ShowController extends Controller {
$list = $this->fyydapi->queryPodcast($podcast_id);
foreach($data as $localEpisode) {
if ($localEpisode->getId() == $list['data']['id']) {
if ($localEpisode->getId() === $list['data']['id']) {
$list['data']['dateadded'] = $localEpisode->getDateadded();
}
}
......@@ -77,7 +77,7 @@ class ShowController extends Controller {
$data = array_slice($data, $page * $count, $count);
if (count($data) == $count) {
if (count($data) === $count) {
$nextPage = $page + 1;
} else {
$nextPage = null;
......
......@@ -57,7 +57,7 @@ class EpisodeMapper extends QBMapper {
*/
public function findAll(string $userId, string $sortBy = null): array {
if ($sortBy) {
if ($sortBy == 'pubdate') {
if ($sortBy === 'pubdate') {
$sortBy = 'pubdate';
} else {
$sortBy = 'lastplayed';
......@@ -74,7 +74,7 @@ class EpisodeMapper extends QBMapper {
/* For listening view, query only episodes which were already
listened */
if ($sortBy == 'lastplayed') {
if ($sortBy === 'lastplayed') {
$qb->andWhere($qb->expr()->gt('playtime',$qb->createNamedParameter(0)));
};
......
......@@ -117,13 +117,13 @@ class FyydApiService {
public function queryCategory(string $category, int $count = 20,
int $page = 0) {
if ($category == 'hot') {
if ($category === 'hot') {
$url = $this->baseUrl . "/feature/podcast/hot";
$options['query'] = [
'count' => $count,
'page' => $page,
];
} else if ($category == 'latest') {
} else if ($category === 'latest') {
$url = $this->baseUrl . "/podcast/latest";
$options['query'] = [
'count' => $count,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment