Skip to content

Commit

Permalink
Introduce class TestCase
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Dec 13, 2022
1 parent ef41976 commit a073b88
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace ipl\Tests\Sql;

use ipl\Sql\Select;
use ipl\Tests\Sql\Lib\SqlAssertions;

abstract class TestCase extends \PHPUnit\Framework\TestCase
{
use SqlAssertions {
SqlAssertions::setUp as sqlAssertionsSetUp;
}

/** @var string The statement to use */
protected $queryClass = Select::class;

/** @var Select The statement in use */
protected $query;

protected function setUp(): void
{
$this->query = new $this->queryClass();
$this->sqlAssertionsSetUp();
}

/** @deprecated Unused. */
protected function setupTest()
{
}

/**
* @deprecated Use {@see self::assertSql} instead.
*
* @param string $statement
* @param array $values
*
* @return void
*/
protected function assertCorrectStatementAndValues($statement, $values = null)
{
$this->assertSql($statement, $this->query, $values);
}
}

0 comments on commit a073b88

Please sign in to comment.