Skip to content

Commit

Permalink
Merge pull request #14 from bjuppa/laravel7
Browse files Browse the repository at this point in the history
Tests for Laravel 7
  • Loading branch information
bjuppa authored Mar 27, 2020
2 parents 76bb32d + 820f583 commit 10a88e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ matrix:
env: LARAVEL='6.*'
- php: 7.3
env: LARAVEL='6.*'
- php: 7.4
env: LARAVEL='7.*'
fast_finish: true

before_install:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"bjuppa/laravel-blog": "^1.3"
},
"require-dev": {
"orchestra/testbench": "~3.8 || ^4.0",
"orchestra/testbench": "~3.8 || ^4.0 || ^5.0",
"phpunit/phpunit": ">6.5",
"mockery/mockery": "^1.0",
"andrefigueira/blog-article-faker": "^1.0",
Expand Down
15 changes: 8 additions & 7 deletions tests/Feature/BlogAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function test_menu_links()
{
$response = $this->actingAs($this->user)->get(route('blog-admin.blogs.show', 'main'));

$response->assertSee('>Main Blog</a>');
$response->assertSee('>Main Blog</a>', false);
}

public function test_show_blog_page()
Expand All @@ -41,17 +41,17 @@ public function test_show_blog_page()
$response = $this->actingAs($this->user)->get(route('blog-admin.blogs.show', 'main'));

$response->assertStatus(200);
$response->assertSee('>Main Blog</h1>');
$response->assertSee('>' . $entry->getTitle() . '</a>');
$response->assertSee('href="' . route('blog-admin.entries.create', 'main') . '"');
$response->assertSee('>Main Blog</h1>', false);
$response->assertSee('>' . $entry->getTitle() . '</a>', false);
$response->assertSee('href="' . route('blog-admin.entries.create', 'main') . '"', false);
}

public function test_create_entry_page()
{
$response = $this->actingAs($this->user)->get(route('blog-admin.entries.create', 'main'));

$response->assertStatus(200);
$response->assertSee('value="main"');
$response->assertSee('value="main"', false);
}

public function test_entry_can_be_stored()
Expand All @@ -74,7 +74,7 @@ public function test_edit_entry_page()
$response = $this->actingAs($this->user)->get(route('blog-admin.entries.edit', [$entry->getBlogId(), $entry->getKey()]));

$response->assertStatus(200);
$response->assertSee('value="PATCH"');
$response->assertSee('value="PATCH"', false);
}

public function test_entry_can_be_updated()
Expand All @@ -95,7 +95,8 @@ public function test_entry_can_be_updated()
$this->assertEquals(new Carbon('tomorrow noon'), $entry->publish_after, 'Time was not parsed properly from string');
}

public function test_entry_cant_be_moved_to_non_existing_blog() {
public function test_entry_cant_be_moved_to_non_existing_blog()
{
$entry = factory(BlogEntry::class)->create();
$entry->refresh();

Expand Down

0 comments on commit 10a88e1

Please sign in to comment.