tab to space
This commit is contained in:
		| @@ -9,63 +9,63 @@ use Tests\TestCase; | ||||
|  | ||||
| abstract class FeatureTestCase extends TestCase | ||||
| { | ||||
| 	protected $faker; | ||||
|     protected $faker; | ||||
|  | ||||
| 	protected $user; | ||||
|     protected $user; | ||||
|  | ||||
| 	protected $company; | ||||
|     protected $company; | ||||
|  | ||||
| 	protected function setUp(): void | ||||
| 	{ | ||||
| 		parent::setUp(); | ||||
|     protected function setUp(): void | ||||
|     { | ||||
|         parent::setUp(); | ||||
|  | ||||
| 		$this->withoutExceptionHandling(); | ||||
|         $this->withoutExceptionHandling(); | ||||
|  | ||||
| 		$this->faker = Factory::create(); | ||||
| 		$this->user = User::first(); | ||||
| 		$this->company = $this->user->companies()->first(); | ||||
|         $this->faker = Factory::create(); | ||||
|         $this->user = User::first(); | ||||
|         $this->company = $this->user->companies()->first(); | ||||
|  | ||||
| 		session(['company_id' => $this->company->id]); | ||||
|         session(['company_id' => $this->company->id]); | ||||
|  | ||||
| 		// Set Company settings | ||||
|         // Set Company settings | ||||
|         setting()->setExtraColumns(['company_id' => $this->company->id]); | ||||
|         setting()->forgetAll(); | ||||
| 		setting()->load(true); | ||||
|         setting()->load(true); | ||||
|  | ||||
| 		// Disable debugbar | ||||
| 		config(['debugbar.enabled', false]); | ||||
| 	} | ||||
|         // Disable debugbar | ||||
|         config(['debugbar.enabled', false]); | ||||
|     } | ||||
|  | ||||
| 	/** | ||||
| 	 * Empty for default user. | ||||
| 	 * | ||||
| 	 * @param User|null $user | ||||
| 	 * @param Company|null $company | ||||
| 	 * @return FeatureTestCase | ||||
| 	 */ | ||||
| 	public function loginAs(User $user = null, Company $company = null) | ||||
| 	{ | ||||
| 		if (!$user) { | ||||
| 		    $user = $this->user; | ||||
| 		} | ||||
|     /** | ||||
|      * Empty for default user. | ||||
|      * | ||||
|      * @param User|null $user | ||||
|      * @param Company|null $company | ||||
|      * @return FeatureTestCase | ||||
|      */ | ||||
|     public function loginAs(User $user = null, Company $company = null) | ||||
|     { | ||||
|         if (!$user) { | ||||
|             $user = $this->user; | ||||
|         } | ||||
|  | ||||
| 		if (!$company) { | ||||
| 		    $company = $this->company; | ||||
| 		} | ||||
|         if (!$company) { | ||||
|             $company = $this->company; | ||||
|         } | ||||
|  | ||||
| 		$this->startSession(); | ||||
|         $this->startSession(); | ||||
|  | ||||
| 		return $this->actingAs($user)->withSession(['company_id' => $company->id]); | ||||
| 	} | ||||
|         return $this->actingAs($user)->withSession(['company_id' => $company->id]); | ||||
|     } | ||||
|  | ||||
| 	public function assertFlashLevel($excepted) | ||||
| 	{ | ||||
| 		$flash['level'] = null; | ||||
|     public function assertFlashLevel($excepted) | ||||
|     { | ||||
|         $flash['level'] = null; | ||||
|  | ||||
| 		if ($flashMessage = session('flash_notification')) { | ||||
| 			$flash = $flashMessage->first(); | ||||
| 		} | ||||
|         if ($flashMessage = session('flash_notification')) { | ||||
|             $flash = $flashMessage->first(); | ||||
|         } | ||||
|  | ||||
| 		$this->assertEquals($excepted, $flash['level']); | ||||
| 	} | ||||
|         $this->assertEquals($excepted, $flash['level']); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user