Skip to content

Commit

Permalink
Merge 1f97b5d into 394f654
Browse files Browse the repository at this point in the history
  • Loading branch information
dschoenbauer committed Sep 11, 2018
2 parents 394f654 + 1f97b5d commit 773c7f7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Sql/Command/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Select extends AbstractCommand

private $table;
private $fields = ['*'];
private $data = [];
private $data = null;
private $fetchStyle = \PDO::FETCH_ASSOC;
private $fetchFlat = false;
private $defaultValue = [];
Expand Down Expand Up @@ -159,11 +159,11 @@ public function getSql()

/**
* acts as a cache to house ran queries
* @param array $data data to be stored
* @param mixed $data data to be stored
* @return Select for method chaining
* @since v1.0.0
*/
public function setData(array $data)
public function setData($data)
{
$this->data = $data;
return $this;
Expand Down
4 changes: 2 additions & 2 deletions src/Sql/Exception/NoRecordsAffectedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
*/
namespace DSchoenbauer\Sql\Exception;

use DSchoenbauer\Exception\Http\ClientError\NotFoundException;
use DSchoenbauer\Exception\Http\ClientError\ConflictException;

/**
* No Records are being impacted by the query
*
* @author David Schoenbauer
*/
class NoRecordsAffectedException extends NotFoundException implements SqlExceptionInterface
class NoRecordsAffectedException extends ConflictException implements SqlExceptionInterface
{

}
4 changes: 3 additions & 1 deletion tests/src/Sql/Command/SelectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ public function testDefaultValueConstructor()

public function testData()
{
$this->assertEquals([], $this->_object->getData());
$this->assertEquals(null, $this->_object->getData());
$this->assertEquals(['id', 'name'], $this->_object->setData(['id', 'name'])->getData());
$this->assertEquals(false, $this->_object->setData(false)->getData());
$this->assertEquals('test', $this->_object->setData('test')->getData());
}

public function testSql()
Expand Down
4 changes: 3 additions & 1 deletion tests/src/Sql/Exception/NoRecordsAffectedExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
namespace DSchoenbauer\Sql\Exception;

use DSchoenbauer\Exception\Http\ClientError\ConflictException;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -33,6 +34,7 @@
*/
class NoRecordsAffectedExceptionTest extends TestCase
{
private $object;

protected function setUp()
{
Expand All @@ -45,6 +47,6 @@ public function testHasBaseInterface()
}

public function testHasCorrectParent(){

$this->assertInstanceOf(ConflictException::class, $this->object);
}
}

0 comments on commit 773c7f7

Please sign in to comment.