2014-10-19 19:52:27 +02:00
|
|
|
<?php
|
|
|
|
namespace Szurubooru\Tests\PDOEx;
|
|
|
|
use Szurubooru\PDOEx\PDOEx;
|
|
|
|
use Szurubooru\PDOEx\UpdateQuery;
|
|
|
|
use Szurubooru\Tests\AbstractTestCase;
|
|
|
|
|
|
|
|
final class UpdateQueryTest extends AbstractTestCase
|
|
|
|
{
|
2015-11-25 09:48:03 +01:00
|
|
|
public function testDefault()
|
|
|
|
{
|
|
|
|
$query = $this->getUpdateQuery();
|
|
|
|
$query->set(['key1' => 'value', 'key2' => 'value2']);
|
|
|
|
$this->assertRegExp('/^UPDATE test SET key1 = :\w*, key2 = :\w*$/', $query->getQuery());
|
|
|
|
}
|
2014-10-19 19:52:27 +02:00
|
|
|
|
2015-11-25 09:48:03 +01:00
|
|
|
private function getUpdateQuery()
|
|
|
|
{
|
|
|
|
$pdoMock = $this->mock(PDOEx::class);
|
|
|
|
return new UpdateQuery($pdoMock, 'test');
|
|
|
|
}
|
2014-10-19 19:52:27 +02:00
|
|
|
}
|