Open havietduc91 opened 8 years ago
Các chức năng cần test: intergration/repositories:
/** @test */
public function it_can_fetch_all_solution_providers()
{
$solutionProviders = $this->solutionProviderRepository->getAll();
foreach($solutionProviders as $solutionProvider){
$this->assertInstanceOf(SolutionProvider::class, $solutionProvider);
}
$this->assertCount(count($this->solution_provider), $solutionProviders);
}
/** test subcategory, main_category có giống nhau không**/
functional/Controller
public function non_admins_cannot_view_blog_posts_marked_as_draft(\FunctionalTester $I)
{
$I->am('A random website visitor');
$I->amGoingTo('Try to view a Blog Post that is marked as draft');
$I->amOnPage('/blog/example-unpublished-post');
$I->canSeePageNotFound();
}
public function admins_can_view_blog_posts_marked_as_draft(\FunctionalTester $I)
{
$I->am('An Admin');
$I->amGoingTo('Try to view a Blog Post that is marked as draft');
$I->loginAsAdmin();
$I->amOnPage('/blog/example-unpublished-post');
$I->canSeeResponseCodeIs(200);
}
public function non_existing_blog_posts_should_give_an_404_error(\FunctionalTester $I)
{
$I->am('A random website visitor');
$I->amGoingTo('Navigate to a blog post that doesnt exists');
$I->amOnPage('/blog/random-slug');
$I->canSeeResponseCodeIs(404);
}