Showing
21 changed files
with
71 additions
and
80 deletions
| ... | @@ -36,10 +36,9 @@ | ... | @@ -36,10 +36,9 @@ |
| 36 | } | 36 | } |
| 37 | }, | 37 | }, |
| 38 | "autoload-dev": { | 38 | "autoload-dev": { |
| 39 | - "classmap": [ | 39 | + "psr-4": { |
| 40 | - "tests/TestCase.php", | 40 | + "Tests\\": "tests/" |
| 41 | - "tests/BrowserKitTest.php" | 41 | + } |
| 42 | - ] | ||
| 43 | }, | 42 | }, |
| 44 | "scripts": { | 43 | "scripts": { |
| 45 | "post-root-package-install": [ | 44 | "post-root-package-install": [ | ... | ... |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | 2 | ||
| 3 | class AttachmentTest extends BrowserKitTest | 3 | class AttachmentTest extends BrowserKitTest |
| 4 | { | 4 | { |
| ... | @@ -75,7 +75,6 @@ class AttachmentTest extends BrowserKitTest | ... | @@ -75,7 +75,6 @@ class AttachmentTest extends BrowserKitTest |
| 75 | { | 75 | { |
| 76 | $page = \BookStack\Page::first(); | 76 | $page = \BookStack\Page::first(); |
| 77 | $this->asAdmin(); | 77 | $this->asAdmin(); |
| 78 | - $admin = $this->getAdmin(); | ||
| 79 | $fileName = 'upload_test_file.txt'; | 78 | $fileName = 'upload_test_file.txt'; |
| 80 | 79 | ||
| 81 | $this->uploadFile($fileName, $page->id); | 80 | $this->uploadFile($fileName, $page->id); | ... | ... |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | 2 | ||
| 3 | use BookStack\Notifications\ConfirmEmail; | 3 | use BookStack\Notifications\ConfirmEmail; |
| 4 | use Illuminate\Support\Facades\Notification; | 4 | use Illuminate\Support\Facades\Notification; |
| ... | @@ -88,7 +88,7 @@ class AuthTest extends BrowserKitTest | ... | @@ -88,7 +88,7 @@ class AuthTest extends BrowserKitTest |
| 88 | ->press('Resend Confirmation Email'); | 88 | ->press('Resend Confirmation Email'); |
| 89 | 89 | ||
| 90 | // Get confirmation and confirm notification matches | 90 | // Get confirmation and confirm notification matches |
| 91 | - $emailConfirmation = DB::table('email_confirmations')->where('user_id', '=', $dbUser->id)->first(); | 91 | + $emailConfirmation = \DB::table('email_confirmations')->where('user_id', '=', $dbUser->id)->first(); |
| 92 | Notification::assertSentTo($dbUser, ConfirmEmail::class, function($notification, $channels) use ($emailConfirmation) { | 92 | Notification::assertSentTo($dbUser, ConfirmEmail::class, function($notification, $channels) use ($emailConfirmation) { |
| 93 | return $notification->token === $emailConfirmation->token; | 93 | return $notification->token === $emailConfirmation->token; |
| 94 | }); | 94 | }); |
| ... | @@ -177,7 +177,7 @@ class AuthTest extends BrowserKitTest | ... | @@ -177,7 +177,7 @@ class AuthTest extends BrowserKitTest |
| 177 | ->seePageIs('/settings/users'); | 177 | ->seePageIs('/settings/users'); |
| 178 | 178 | ||
| 179 | $userPassword = \BookStack\User::find($user->id)->password; | 179 | $userPassword = \BookStack\User::find($user->id)->password; |
| 180 | - $this->assertTrue(Hash::check('newpassword', $userPassword)); | 180 | + $this->assertTrue(\Hash::check('newpassword', $userPassword)); |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | public function test_user_deletion() | 183 | public function test_user_deletion() |
| ... | @@ -238,7 +238,6 @@ class AuthTest extends BrowserKitTest | ... | @@ -238,7 +238,6 @@ class AuthTest extends BrowserKitTest |
| 238 | Notification::assertSentTo($user, \BookStack\Notifications\ResetPassword::class); | 238 | Notification::assertSentTo($user, \BookStack\Notifications\ResetPassword::class); |
| 239 | $n = Notification::sent($user, \BookStack\Notifications\ResetPassword::class); | 239 | $n = Notification::sent($user, \BookStack\Notifications\ResetPassword::class); |
| 240 | 240 | ||
| 241 | - $reset = DB::table('password_resets')->where('email', '=', 'admin@admin.com')->first(); | ||
| 242 | $this->visit('/password/reset/' . $n->first()->token) | 241 | $this->visit('/password/reset/' . $n->first()->token) |
| 243 | ->see('Reset Password') | 242 | ->see('Reset Password') |
| 244 | ->submitForm('Reset Password', [ | 243 | ->submitForm('Reset Password', [ | ... | ... |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | use BookStack\User; | 2 | use BookStack\User; |
| 3 | 3 | ||
| 4 | class LdapTest extends BrowserKitTest | 4 | class LdapTest extends BrowserKitTest |
| ... | @@ -12,7 +12,7 @@ class LdapTest extends BrowserKitTest | ... | @@ -12,7 +12,7 @@ class LdapTest extends BrowserKitTest |
| 12 | { | 12 | { |
| 13 | parent::setUp(); | 13 | parent::setUp(); |
| 14 | app('config')->set(['auth.method' => 'ldap', 'services.ldap.base_dn' => 'dc=ldap,dc=local', 'auth.providers.users.driver' => 'ldap']); | 14 | app('config')->set(['auth.method' => 'ldap', 'services.ldap.base_dn' => 'dc=ldap,dc=local', 'auth.providers.users.driver' => 'ldap']); |
| 15 | - $this->mockLdap = Mockery::mock(BookStack\Services\Ldap::class); | 15 | + $this->mockLdap = \Mockery::mock(\BookStack\Services\Ldap::class); |
| 16 | $this->app['BookStack\Services\Ldap'] = $this->mockLdap; | 16 | $this->app['BookStack\Services\Ldap'] = $this->mockLdap; |
| 17 | $this->mockUser = factory(User::class)->make(); | 17 | $this->mockUser = factory(User::class)->make(); |
| 18 | } | 18 | } |
| ... | @@ -22,7 +22,7 @@ class LdapTest extends BrowserKitTest | ... | @@ -22,7 +22,7 @@ class LdapTest extends BrowserKitTest |
| 22 | $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); | 22 | $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); |
| 23 | $this->mockLdap->shouldReceive('setVersion')->once(); | 23 | $this->mockLdap->shouldReceive('setVersion')->once(); |
| 24 | $this->mockLdap->shouldReceive('searchAndGetEntries')->times(4) | 24 | $this->mockLdap->shouldReceive('searchAndGetEntries')->times(4) |
| 25 | - ->with($this->resourceId, config('services.ldap.base_dn'), Mockery::type('string'), Mockery::type('array')) | 25 | + ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) |
| 26 | ->andReturn(['count' => 1, 0 => [ | 26 | ->andReturn(['count' => 1, 0 => [ |
| 27 | 'uid' => [$this->mockUser->name], | 27 | 'uid' => [$this->mockUser->name], |
| 28 | 'cn' => [$this->mockUser->name], | 28 | 'cn' => [$this->mockUser->name], |
| ... | @@ -50,7 +50,7 @@ class LdapTest extends BrowserKitTest | ... | @@ -50,7 +50,7 @@ class LdapTest extends BrowserKitTest |
| 50 | $this->mockLdap->shouldReceive('setVersion')->once(); | 50 | $this->mockLdap->shouldReceive('setVersion')->once(); |
| 51 | $ldapDn = 'cn=test-user,dc=test' . config('services.ldap.base_dn'); | 51 | $ldapDn = 'cn=test-user,dc=test' . config('services.ldap.base_dn'); |
| 52 | $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) | 52 | $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) |
| 53 | - ->with($this->resourceId, config('services.ldap.base_dn'), Mockery::type('string'), Mockery::type('array')) | 53 | + ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) |
| 54 | ->andReturn(['count' => 1, 0 => [ | 54 | ->andReturn(['count' => 1, 0 => [ |
| 55 | 'cn' => [$this->mockUser->name], | 55 | 'cn' => [$this->mockUser->name], |
| 56 | 'dn' => $ldapDn, | 56 | 'dn' => $ldapDn, |
| ... | @@ -73,7 +73,7 @@ class LdapTest extends BrowserKitTest | ... | @@ -73,7 +73,7 @@ class LdapTest extends BrowserKitTest |
| 73 | $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); | 73 | $this->mockLdap->shouldReceive('connect')->once()->andReturn($this->resourceId); |
| 74 | $this->mockLdap->shouldReceive('setVersion')->once(); | 74 | $this->mockLdap->shouldReceive('setVersion')->once(); |
| 75 | $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) | 75 | $this->mockLdap->shouldReceive('searchAndGetEntries')->times(2) |
| 76 | - ->with($this->resourceId, config('services.ldap.base_dn'), Mockery::type('string'), Mockery::type('array')) | 76 | + ->with($this->resourceId, config('services.ldap.base_dn'), \Mockery::type('string'), \Mockery::type('array')) |
| 77 | ->andReturn(['count' => 1, 0 => [ | 77 | ->andReturn(['count' => 1, 0 => [ |
| 78 | 'uid' => [$this->mockUser->name], | 78 | 'uid' => [$this->mockUser->name], |
| 79 | 'cn' => [$this->mockUser->name], | 79 | 'cn' => [$this->mockUser->name], | ... | ... |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | 2 | ||
| 3 | class SocialAuthTest extends BrowserKitTest | 3 | class SocialAuthTest extends BrowserKitTest |
| 4 | { | 4 | { |
| ... | @@ -11,10 +11,10 @@ class SocialAuthTest extends BrowserKitTest | ... | @@ -11,10 +11,10 @@ class SocialAuthTest extends BrowserKitTest |
| 11 | $this->setSettings(['registration-enabled' => 'true']); | 11 | $this->setSettings(['registration-enabled' => 'true']); |
| 12 | config(['GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost']); | 12 | config(['GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', 'APP_URL' => 'http://localhost']); |
| 13 | 13 | ||
| 14 | - $mockSocialite = Mockery::mock('Laravel\Socialite\Contracts\Factory'); | 14 | + $mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory'); |
| 15 | $this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite; | 15 | $this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite; |
| 16 | - $mockSocialDriver = Mockery::mock('Laravel\Socialite\Contracts\Provider'); | 16 | + $mockSocialDriver = \Mockery::mock('Laravel\Socialite\Contracts\Provider'); |
| 17 | - $mockSocialUser = Mockery::mock('\Laravel\Socialite\Contracts\User'); | 17 | + $mockSocialUser = \Mockery::mock('\Laravel\Socialite\Contracts\User'); |
| 18 | 18 | ||
| 19 | $mockSocialite->shouldReceive('driver')->twice()->with('google')->andReturn($mockSocialDriver); | 19 | $mockSocialite->shouldReceive('driver')->twice()->with('google')->andReturn($mockSocialDriver); |
| 20 | $mockSocialDriver->shouldReceive('redirect')->once()->andReturn(redirect('/')); | 20 | $mockSocialDriver->shouldReceive('redirect')->once()->andReturn(redirect('/')); |
| ... | @@ -34,18 +34,16 @@ class SocialAuthTest extends BrowserKitTest | ... | @@ -34,18 +34,16 @@ class SocialAuthTest extends BrowserKitTest |
| 34 | 34 | ||
| 35 | public function test_social_login() | 35 | public function test_social_login() |
| 36 | { | 36 | { |
| 37 | - $user = factory(\BookStack\User::class)->make(); | ||
| 38 | - | ||
| 39 | config([ | 37 | config([ |
| 40 | 'GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', | 38 | 'GOOGLE_APP_ID' => 'abc123', 'GOOGLE_APP_SECRET' => '123abc', |
| 41 | 'GITHUB_APP_ID' => 'abc123', 'GITHUB_APP_SECRET' => '123abc', | 39 | 'GITHUB_APP_ID' => 'abc123', 'GITHUB_APP_SECRET' => '123abc', |
| 42 | 'APP_URL' => 'http://localhost' | 40 | 'APP_URL' => 'http://localhost' |
| 43 | ]); | 41 | ]); |
| 44 | 42 | ||
| 45 | - $mockSocialite = Mockery::mock('Laravel\Socialite\Contracts\Factory'); | 43 | + $mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory'); |
| 46 | $this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite; | 44 | $this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite; |
| 47 | - $mockSocialDriver = Mockery::mock('Laravel\Socialite\Contracts\Provider'); | 45 | + $mockSocialDriver = \Mockery::mock('Laravel\Socialite\Contracts\Provider'); |
| 48 | - $mockSocialUser = Mockery::mock('\Laravel\Socialite\Contracts\User'); | 46 | + $mockSocialUser = \Mockery::mock('\Laravel\Socialite\Contracts\User'); |
| 49 | 47 | ||
| 50 | $mockSocialUser->shouldReceive('getId')->twice()->andReturn('logintest123'); | 48 | $mockSocialUser->shouldReceive('getId')->twice()->andReturn('logintest123'); |
| 51 | 49 | ||
| ... | @@ -68,7 +66,7 @@ class SocialAuthTest extends BrowserKitTest | ... | @@ -68,7 +66,7 @@ class SocialAuthTest extends BrowserKitTest |
| 68 | ->seePageIs('/login'); | 66 | ->seePageIs('/login'); |
| 69 | 67 | ||
| 70 | // Test social callback with matching social account | 68 | // Test social callback with matching social account |
| 71 | - DB::table('social_accounts')->insert([ | 69 | + \DB::table('social_accounts')->insert([ |
| 72 | 'user_id' => $this->getAdmin()->id, | 70 | 'user_id' => $this->getAdmin()->id, |
| 73 | 'driver' => 'github', | 71 | 'driver' => 'github', |
| 74 | 'driver_id' => 'logintest123' | 72 | 'driver_id' => 'logintest123' | ... | ... |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | 2 | ||
| 3 | +use BookStack\Role; | ||
| 4 | +use Illuminate\Contracts\Console\Kernel; | ||
| 3 | use Illuminate\Foundation\Testing\DatabaseTransactions; | 5 | use Illuminate\Foundation\Testing\DatabaseTransactions; |
| 6 | +use Laravel\BrowserKitTesting\TestCase; | ||
| 4 | use Symfony\Component\DomCrawler\Crawler; | 7 | use Symfony\Component\DomCrawler\Crawler; |
| 5 | 8 | ||
| 6 | -abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | 9 | +abstract class BrowserKitTest extends TestCase |
| 7 | { | 10 | { |
| 8 | 11 | ||
| 9 | use DatabaseTransactions; | 12 | use DatabaseTransactions; |
| ... | @@ -28,7 +31,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | ... | @@ -28,7 +31,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase |
| 28 | { | 31 | { |
| 29 | $app = require __DIR__.'/../bootstrap/app.php'; | 32 | $app = require __DIR__.'/../bootstrap/app.php'; |
| 30 | 33 | ||
| 31 | - $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); | 34 | + $app->make(Kernel::class)->bootstrap(); |
| 32 | 35 | ||
| 33 | return $app; | 36 | return $app; |
| 34 | } | 37 | } |
| ... | @@ -48,7 +51,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | ... | @@ -48,7 +51,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase |
| 48 | */ | 51 | */ |
| 49 | public function getAdmin() { | 52 | public function getAdmin() { |
| 50 | if($this->admin === null) { | 53 | if($this->admin === null) { |
| 51 | - $adminRole = \BookStack\Role::getRole('admin'); | 54 | + $adminRole = Role::getRole('admin'); |
| 52 | $this->admin = $adminRole->users->first(); | 55 | $this->admin = $adminRole->users->first(); |
| 53 | } | 56 | } |
| 54 | return $this->admin; | 57 | return $this->admin; |
| ... | @@ -95,9 +98,9 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | ... | @@ -95,9 +98,9 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase |
| 95 | protected function createEntityChainBelongingToUser($creatorUser, $updaterUser = false) | 98 | protected function createEntityChainBelongingToUser($creatorUser, $updaterUser = false) |
| 96 | { | 99 | { |
| 97 | if ($updaterUser === false) $updaterUser = $creatorUser; | 100 | if ($updaterUser === false) $updaterUser = $creatorUser; |
| 98 | - $book = factory(BookStack\Book::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); | 101 | + $book = factory(\BookStack\Book::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); |
| 99 | - $chapter = factory(BookStack\Chapter::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); | 102 | + $chapter = factory(\BookStack\Chapter::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]); |
| 100 | - $page = factory(BookStack\Page::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id]); | 103 | + $page = factory(\BookStack\Page::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id]); |
| 101 | $book->chapters()->saveMany([$chapter]); | 104 | $book->chapters()->saveMany([$chapter]); |
| 102 | $chapter->pages()->saveMany([$page]); | 105 | $chapter->pages()->saveMany([$page]); |
| 103 | $restrictionService = $this->app[\BookStack\Services\PermissionService::class]; | 106 | $restrictionService = $this->app[\BookStack\Services\PermissionService::class]; |
| ... | @@ -117,7 +120,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | ... | @@ -117,7 +120,7 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase |
| 117 | protected function getEditor($attributes = []) | 120 | protected function getEditor($attributes = []) |
| 118 | { | 121 | { |
| 119 | $user = factory(\BookStack\User::class)->create($attributes); | 122 | $user = factory(\BookStack\User::class)->create($attributes); |
| 120 | - $role = \BookStack\Role::getRole('editor'); | 123 | + $role = Role::getRole('editor'); |
| 121 | $user->attachRole($role);; | 124 | $user->attachRole($role);; |
| 122 | return $user; | 125 | return $user; |
| 123 | } | 126 | } |
| ... | @@ -211,7 +214,6 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | ... | @@ -211,7 +214,6 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase |
| 211 | /** | 214 | /** |
| 212 | * Check if the page contains the given element. | 215 | * Check if the page contains the given element. |
| 213 | * @param string $selector | 216 | * @param string $selector |
| 214 | - * @return bool | ||
| 215 | */ | 217 | */ |
| 216 | protected function pageHasElement($selector) | 218 | protected function pageHasElement($selector) |
| 217 | { | 219 | { |
| ... | @@ -223,7 +225,6 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase | ... | @@ -223,7 +225,6 @@ abstract class BrowserKitTest extends \Laravel\BrowserKitTesting\TestCase |
| 223 | /** | 225 | /** |
| 224 | * Check if the page contains the given element. | 226 | * Check if the page contains the given element. |
| 225 | * @param string $selector | 227 | * @param string $selector |
| 226 | - * @return bool | ||
| 227 | */ | 228 | */ |
| 228 | protected function pageNotHasElement($selector) | 229 | protected function pageNotHasElement($selector) |
| 229 | { | 230 | { | ... | ... |
tests/CreatesApplication.php
0 → 100644
| 1 | +<?php namespace Tests; | ||
| 2 | + | ||
| 3 | +use Illuminate\Contracts\Console\Kernel; | ||
| 4 | + | ||
| 5 | +trait CreatesApplication | ||
| 6 | +{ | ||
| 7 | + /** | ||
| 8 | + * Creates the application. | ||
| 9 | + * | ||
| 10 | + * @return \Illuminate\Foundation\Application | ||
| 11 | + */ | ||
| 12 | + public function createApplication() | ||
| 13 | + { | ||
| 14 | + $app = require __DIR__.'/../bootstrap/app.php'; | ||
| 15 | + $app->make(Kernel::class)->bootstrap(); | ||
| 16 | + return $app; | ||
| 17 | + } | ||
| 18 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | 2 | ||
| 3 | -use Illuminate\Foundation\Testing\DatabaseTransactions; | 3 | +use Illuminate\Foundation\Testing\TestCase as BaseTestCase; |
| 4 | -use Symfony\Component\DomCrawler\Crawler; | ||
| 5 | 4 | ||
| 6 | -class TestCase extends Illuminate\Foundation\Testing\TestCase | 5 | +abstract class TestCase extends BaseTestCase |
| 7 | { | 6 | { |
| 8 | - | 7 | + use CreatesApplication; |
| 9 | - use DatabaseTransactions; | 8 | +} |
| 10 | - | ||
| 11 | - /** | ||
| 12 | - * The base URL of the application. | ||
| 13 | - * | ||
| 14 | - * @var string | ||
| 15 | - */ | ||
| 16 | - public $baseUrl = 'http://localhost'; | ||
| 17 | - | ||
| 18 | - /** | ||
| 19 | - * Creates the application. | ||
| 20 | - * | ||
| 21 | - * @return \Illuminate\Foundation\Application | ||
| 22 | - */ | ||
| 23 | - public function createApplication() | ||
| 24 | - { | ||
| 25 | - $app = require __DIR__.'/../bootstrap/app.php'; | ||
| 26 | - | ||
| 27 | - $app->make(Kernel::class)->bootstrap(); | ||
| 28 | - | ||
| 29 | - return $app; | ||
| 30 | - } | ||
| 31 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | -<?php | 1 | +<?php namespace Tests; |
| 2 | 2 | ||
| 3 | class UserProfileTest extends BrowserKitTest | 3 | class UserProfileTest extends BrowserKitTest |
| 4 | { | 4 | { |
| ... | @@ -55,8 +55,8 @@ class UserProfileTest extends BrowserKitTest | ... | @@ -55,8 +55,8 @@ class UserProfileTest extends BrowserKitTest |
| 55 | $newUser = $this->getEditor(); | 55 | $newUser = $this->getEditor(); |
| 56 | $this->actingAs($newUser); | 56 | $this->actingAs($newUser); |
| 57 | $entities = $this->createEntityChainBelongingToUser($newUser, $newUser); | 57 | $entities = $this->createEntityChainBelongingToUser($newUser, $newUser); |
| 58 | - Activity::add($entities['book'], 'book_update', $entities['book']->id); | 58 | + \Activity::add($entities['book'], 'book_update', $entities['book']->id); |
| 59 | - Activity::add($entities['page'], 'page_create', $entities['book']->id); | 59 | + \Activity::add($entities['page'], 'page_create', $entities['book']->id); |
| 60 | 60 | ||
| 61 | $this->asAdmin()->visit('/user/' . $newUser->id) | 61 | $this->asAdmin()->visit('/user/' . $newUser->id) |
| 62 | ->seeInElement('#recent-activity', 'updated book') | 62 | ->seeInElement('#recent-activity', 'updated book') |
| ... | @@ -69,8 +69,8 @@ class UserProfileTest extends BrowserKitTest | ... | @@ -69,8 +69,8 @@ class UserProfileTest extends BrowserKitTest |
| 69 | $newUser = $this->getEditor(); | 69 | $newUser = $this->getEditor(); |
| 70 | $this->actingAs($newUser); | 70 | $this->actingAs($newUser); |
| 71 | $entities = $this->createEntityChainBelongingToUser($newUser, $newUser); | 71 | $entities = $this->createEntityChainBelongingToUser($newUser, $newUser); |
| 72 | - Activity::add($entities['book'], 'book_update', $entities['book']->id); | 72 | + \Activity::add($entities['book'], 'book_update', $entities['book']->id); |
| 73 | - Activity::add($entities['page'], 'page_create', $entities['book']->id); | 73 | + \Activity::add($entities['page'], 'page_create', $entities['book']->id); |
| 74 | 74 | ||
| 75 | $this->asAdmin()->visit('/')->clickInElement('#recent-activity', $newUser->name) | 75 | $this->asAdmin()->visit('/')->clickInElement('#recent-activity', $newUser->name) |
| 76 | ->seePageIs('/user/' . $newUser->id) | 76 | ->seePageIs('/user/' . $newUser->id) | ... | ... |
-
Please register or sign in to post a comment