Skip to content

Commit

Permalink
Update QueryDataTableTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulrhmansouda committed Apr 13, 2024
1 parent 8a9104a commit 8a798df
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions tests/Unit/QueryDataTableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@ public function test_complex_query_use_select_in_count()
$this->assertEquals(20, $dataTable->count());
}

// public function test_complex_query_can_ignore_select_in_count()
// {
// /** @var \Yajra\DataTables\QueryDataTable $dataTable */
// $dataTable = app('datatables')->of(
// DB::table('users')
// ->select('users.*')
// ->addSelect([
// 'last_post_id' => DB::table('posts')
// ->whereColumn('posts.user_id', 'users.id')
// ->orderBy('created_at')
// ->select('id'),
// ])
// ->orderBy(
// DB::table('posts')->whereColumn('posts.user_id', 'users.id')->orderBy('created_at')->select('created_at')
// )
// )->ignoreSelectsInCountQuery();

// $this->assertQueryHasNoSelect(true, $dataTable->prepareCountQuery());
// $this->assertEquals(20, $dataTable->count());
// }
public function test_simple_query_can_ignore_select_in_count()
{
/** @var \Yajra\DataTables\QueryDataTable $dataTable */
Expand All @@ -94,24 +74,6 @@ public function test_simple_query_can_ignore_select_in_count()
$this->assertEquals(20, $dataTable->count());
}

// public function test_simple_queries_with_complexe_select_are_wrapped_without_selects()
// {
// /** @var \Yajra\DataTables\QueryDataTable $dataTable */
// $dataTable = app('datatables')->of(
// DB::table('users')
// ->select('users.*')
// ->addSelect([
// 'last_post_id' => DB::table('posts')
// ->whereColumn('posts.user_id', 'users.id')
// ->orderBy('created_at')
// ->select('id'),
// ])
// );

// $this->assertQueryWrapped(false, $dataTable->prepareCountQuery());
// $this->assertQueryHasNoSelect(true, $dataTable->prepareCountQuery());
// $this->assertEquals(20, $dataTable->count());
// }
public function test_simple_queries_with_simple_select_are_wrapped_without_selects()
{
/** @var \Yajra\DataTables\QueryDataTable $dataTable */
Expand Down

0 comments on commit 8a798df

Please sign in to comment.