user->attachPermission( Permission::where('name', 'read-admin-panel')->firstOrFail() ); } public function testDeliveryUnpricedPageUsesItsOwnTwentyColumnTable() { $this->grantAdminPermission(); $response = $this->loginAs()->get(route('business.pages.show', [ 'section' => 'supplier-payables', 'page' => 'delivery-unpriced', ])); $response ->assertOk() ->assertSee('id="delivery-unpriced-app"', false) ->assertSee('来源单号') ->assertSee('单据编号(采购单号)') ->assertSee('负责人') ->assertSee('public/js/ecommerce-finance/delivery-unpriced.min.js', false) ->assertDontSee('class="business-blank-page"', false); $this->assertSame(20, substr_count($response->getContent(), 'grantAdminPermission(); $response = $this->loginAs()->get(route('business.pages.show', [ 'section' => 'supplier-payables', 'page' => 'return-unpriced', ])); $response ->assertOk() ->assertSee('id="return-unpriced-app"', false) ->assertSee('明细供应商') ->assertSee('供应商条码') ->assertSee('对账人') ->assertSee('public/js/ecommerce-finance/return-unpriced.min.js', false) ->assertDontSee('class="business-blank-page"', false); $this->assertSame(20, substr_count($response->getContent(), 'grantAdminPermission(); $response = $this->loginAs()->get(route('business.pages.show', [ 'section' => 'supplier-payables', 'page' => 'board-deductions', ])); $response ->assertOk() ->assertSee('class="supplier-board-table"', false) ->assertSee('入库日期') ->assertSee('出库备注') ->assertSee('送货单号') ->assertDontSee('class="business-blank-page"', false); preg_match_all('/)/', $response->getContent(), $headers); $this->assertCount(17, $headers[0]); } public function testSupplierPayablesReportPageUsesItsOwnThirtyFourColumnGroupedTable() { $this->grantAdminPermission(); $response = $this->loginAs()->get(route('business.pages.show', [ 'section' => 'supplier-payables', 'page' => 'supplier-payables-report', ])); $response ->assertOk() ->assertSee('class="supplier-payables-report-table"', false) ->assertSee('已销账供应商') ->assertSee('本月采购金额') ->assertSee('加', false) ->assertSee('单位:元', false) ->assertSee('供应商余额', false) ->assertSee('最晚出账单时间(新执行标准)') ->assertDontSee('class="business-blank-page"', false); preg_match_all('/)/', $response->getContent(), $columns); $this->assertCount(34, $columns[0]); } }