Skip to content

Commit

Permalink
Naming consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Mar 13, 2019
1 parent f25ed70 commit 4b37c24
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/SelectQuery.php → src/SelectBuilder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Gt\SqlBuilder;

abstract class SelectQuery extends SqlQuery {
abstract class SelectBuilder extends SqlBuilder {
public function __toString():string {
return $this->processClauseList([
self::PRE_QUERY_COMMENT => $this->preQuery(),
Expand All @@ -17,7 +17,7 @@ public function __toString():string {
]);
}

/** @return string[]|SqlQuery[] */
/** @return string[]|SqlBuilder[] */
public function select():array {
return [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/SqlQuery.php → src/SqlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use Gt\SqlBuilder\Condition\AndCondition;
use Gt\SqlBuilder\Condition\Condition;

abstract class SqlQuery {
abstract class SqlBuilder {
const PRE_QUERY_COMMENT = "/* preQuery */";
const POST_QUERY_COMMENT = "/* postQuery */";
const WHERE_CLAUSES = ["where", "having"];
Expand Down
2 changes: 1 addition & 1 deletion test/ExampleSelect.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Gt\SqlBuilder;

class ExampleSelect extends SelectQuery {
class ExampleSelect extends SelectBuilder {
public function select():array {
return [
"id",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
namespace Gt\SqlBuilder\Test;

use Gt\SqlBuilder\SelectQuery;
use Gt\SqlBuilder\SelectBuilder;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class SelectQueryTest extends TestCase {
class SelectBuilderTest extends TestCase {
public function testDefaults() {
/** @var MockObject|SelectQuery $sut */
$sut = self::getMockForAbstractClass(SelectQuery::class);
/** @var MockObject|SelectBuilder $sut */
$sut = self::getMockForAbstractClass(SelectBuilder::class);
self::assertEmpty($sut->select());
self::assertEmpty($sut->from());
self::assertEmpty($sut->where());
Expand All @@ -20,7 +20,7 @@ public function testDefaults() {
}

public function testToStringEmpty() {
$sut = self::getMockForAbstractClass(SelectQuery::class);
$sut = self::getMockForAbstractClass(SelectBuilder::class);
self::assertEmpty((string)$sut);
}
}
8 changes: 4 additions & 4 deletions test/unit/SqlQueryTest.php → test/unit/SqlBuilderTest.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php
namespace Gt\SqlBuilder\Test;

use Gt\SqlBuilder\SqlQuery;
use Gt\SqlBuilder\SqlBuilder;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class SqlQueryTest extends TestCase {
class SqlBuilderTest extends TestCase {
public function testDefaults() {
/** @var MockObject|SqlQuery $sut */
$sut = self::getMockForAbstractClass(SqlQuery::class);
/** @var MockObject|SqlBuilder $sut */
$sut = self::getMockForAbstractClass(SqlBuilder::class);
self::assertEquals("", $sut->preQuery());
self::assertEquals("", $sut->postQuery());
}
Expand Down

0 comments on commit 4b37c24

Please sign in to comment.