CombineGridTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Dcat\Admin\Tests\Feature;
  3. use Dcat\Admin\Tests\TestCase;
  4. /**
  5. * @group combine-grid
  6. */
  7. class CombineGridTest extends TestCase
  8. {
  9. public function test()
  10. {
  11. $this->visit('admin/tests/report')
  12. ->assertResponseStatus(200)
  13. ->see('报表')
  14. ->see('avgMonthCost')
  15. ->see('avgVist')
  16. ->see('avgCost')
  17. ->see('top');
  18. // Column::help
  19. $this->assertCount(1, $this->crawler()->filter('th a[class*=fa-question-circle]'));
  20. $this->assertCount(2, $this->crawler()->filter('thead tr'));
  21. $firstTr = $this->crawler()->filter('thead tr')->first()->filter('th');
  22. // cost
  23. $this->assertSame('2', (string) $firstTr->eq(2)->attr('rowspan'));
  24. // avgCost
  25. $this->assertSame('3', (string) $firstTr->eq(3)->attr('colspan'));
  26. // avgVist
  27. $this->assertSame('3', (string) $firstTr->eq(4)->attr('colspan'));
  28. // top
  29. $this->assertSame('3', (string) $firstTr->eq(5)->attr('colspan'));
  30. }
  31. }