File: D:/HostingSpaces/SBogers10/ste.komma.pro/tests/Unit/WildcardResolverTest.php
<?php
namespace App\Tests\Unit;
use App\Pages\Models\Page;
use App\Posts\Models\PostTranslation;
use Tests\TestCase;
class WildcardResolverTest extends TestCase
{
/**
* Test a post wildcard route
*
* @group WildcardResolverTest
* @test
*/
public function PostWildcard()
{
$postTranslation = factory(PostTranslation::class)->create();
$postPage = Page::where('code_name', 'posts')->first();
$postPageTranslation = $postPage->translations()->where('language_id', 104)->get()->first();
self::assertEquals(1, $postPageTranslation->route()->count());
self::assertEquals('/nl/blog', $postPageTranslation->route()->first()->alias);
$postTranslationRoute = $postPageTranslation->route()->first()->alias .'/' . $postTranslation->slug;
$response = $this->get($postTranslationRoute);
$response->assertSee($postTranslation->name);
$response->assertStatus(200);
}
}