TESTING #1931: do something with tests.. Not really usefull
This commit is contained in:
@@ -28,10 +28,13 @@ $factory->define(User::class, function (Faker\Generator $faker) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$factory->define(Content::class, function (Faker\Generator $faker) {
|
$factory->define(Content::class, function (Faker\Generator $faker) {
|
||||||
|
|
||||||
|
$slug = isset($faker->slug) ? $faker->slug : $faker->slug(5);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'title' => $faker->sentence(5),
|
'title' => $faker->sentence(5),
|
||||||
'userId' => 1,
|
'userId' => 1,
|
||||||
'url' => $faker->slug(5),
|
'url' => $slug,
|
||||||
'pageContent' => $faker->text(1500),
|
'pageContent' => $faker->text(1500),
|
||||||
'metaDescription' => $faker->text,
|
'metaDescription' => $faker->text,
|
||||||
'moduleHandler' => config('staticpages.handler'),
|
'moduleHandler' => config('staticpages.handler'),
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
stopOnFailure="false">
|
stopOnFailure="false">
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="unit">
|
<testsuite name="unit">
|
||||||
<directory>./tests/unit/</directory>
|
<directory>./tests/Unit/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<filter>
|
<filter>
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Tests\Unit\Admin\Content;
|
namespace Tests\Unit\Content;
|
||||||
|
|
||||||
use App\CMS\Contracts\Repositories\Content;
|
use App\CMS\Contracts\Repositories\Content;
|
||||||
use App\Models\Content\Content as ContentModel;
|
use App\Models\Content\Content as ContentModel;
|
||||||
+23
-39
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Tests\Unit\Admin\Content;
|
|
||||||
|
namespace Tests\Unit\Content;
|
||||||
|
|
||||||
use App\CMS\Contracts\Repositories\Content;
|
use App\CMS\Contracts\Repositories\Content;
|
||||||
use App\Models\Content\Content as ContentModel;
|
use App\Models\Content\Content as ContentModel;
|
||||||
@@ -41,7 +42,6 @@ class RepositoryTest extends TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Test for selecting homepage.
|
* Test for selecting homepage.
|
||||||
*
|
|
||||||
* At first, it tries to select non-existing homepage. On second try, homepage is created.
|
* At first, it tries to select non-existing homepage. On second try, homepage is created.
|
||||||
*/
|
*/
|
||||||
public function testSelectingHomepage()
|
public function testSelectingHomepage()
|
||||||
@@ -65,44 +65,28 @@ class RepositoryTest extends TestCase
|
|||||||
public function testSelectingAllPages()
|
public function testSelectingAllPages()
|
||||||
{
|
{
|
||||||
$all = $this->content->all();
|
$all = $this->content->all();
|
||||||
|
|
||||||
$this->assertCount(6, $all);
|
$this->assertCount(6, $all);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function testContentVisibilityByPublishedFrom()
|
public function testSelectingByURL()
|
||||||
// {
|
{
|
||||||
// }
|
$slug = 'testing-slug-for-testing-purposes';
|
||||||
//
|
factory(ContentModel::class, 3)->create([
|
||||||
// public function testContentVisibilityByPublishedTo()
|
'userId' => $this->user->id,
|
||||||
// {
|
'status' => Content::STATUS_PUBLIC,
|
||||||
// }
|
'url' => $slug
|
||||||
//
|
]);
|
||||||
// public function testSelectingByURL()
|
|
||||||
// {
|
$page = $this->content->getByURL($slug);
|
||||||
//
|
|
||||||
// }
|
$this->assertNotNull($page);
|
||||||
//
|
$this->assertTrue($page->exists);
|
||||||
// public function testSelectingById()
|
}
|
||||||
// {
|
|
||||||
// }
|
public function testSelectingInvalidPageByURL()
|
||||||
//
|
{
|
||||||
// public function testSelectingInvalidPageByURL()
|
$invalidPage = $this->content->getByURL('non-existing-url');
|
||||||
// {
|
|
||||||
// }
|
$this->assertNull($invalidPage);
|
||||||
//
|
}
|
||||||
// public function testSelectingInvalidPageById()
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function testOverview()
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function testOvervieWithOneStatus()
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function testOverviewWithMultipleStatuses()
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user