### 安裝和運行
~~~php
// 將其加入到 composer.json 并更新:
composer require "phpunit/phpunit:4.0.*"
// 運行測試 (在項目根目錄下運行)
./vendor/bin/phpunit
~~~
### 斷言
~~~php
$this->assertTrue(true);
$this->assertEquals('foo', $bar);
$this->assertCount(1,$times);
$this->assertResponseOk();
$this->assertResponseStatus(403);
$this->assertRedirectedTo('foo');
$this->assertRedirectedToRoute('route.name');
$this->assertRedirectedToAction('Controller@method');
$this->assertViewHas('name');
$this->assertViewHas('age', $value);
$this->assertSessionHasErrors();
// 由單個 key 值來假定 session 有錯誤...
$this->assertSessionHasErrors('name');
// 由多個 key 值來假定 session 有錯誤...
$this->assertSessionHasErrors(array('name', 'age'));
$this->assertHasOldInput();
~~~
### 訪問路由
~~~php
$response = $this->call($method, $uri, $parameters, $files, $server, $content);
$response = $this->callSecure('GET', 'foo/bar');
$this->session(['foo' => 'bar']);
$this->flushSession();
$this->seed();
$this->seed($connection);
~~~
- 參考知識--非必學僅供必要時候查詢
- 知識清單
- Composer 安裝等
- artisan--創建模型-控制器-各種模塊
- Route--路由
- Paginate--分頁
- File--文件
- View--視圖
- template--模版
- Model--模型
- Schema--數據表索引-外鍵-字段類型
- DB-基本使用-查詢語句-joins-聚合--原生sql-增刪改查等
- message--消息
- Validation--驗證規則
- Auth-用戶認證-用戶權限
- Helper-數組對象-路徑-字符串-urls-links等
- Session會話
- Response--回應
- Request--請求
- Redirect--重定向
- Environment--環境
- Log--日志
- URL--地址
- Event--事件
- Input--輸入
- Security安全--哈希-加密解密
- Queue--監聽
- Container--容器
- Config--參數設置
- Cache--緩存
- Cookie--設置-獲取--刪除等
- Mail--郵件
- String--字符串
- Collection--集合
- Storage--存儲
- Lang--語言
- 單元測試
- 文件夾結構簡介
- 第一章 laravel8運行環境的搭建(已經有了運行環境的直接跳過)