2018-06-29 19:24:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Amp\Sql\Test;
|
|
|
|
|
2020-05-23 22:44:01 +02:00
|
|
|
use Amp\PHPUnit\AsyncTestCase;
|
2018-06-29 19:24:35 +02:00
|
|
|
use Amp\Sql\QueryError;
|
|
|
|
|
2020-05-23 22:44:01 +02:00
|
|
|
class QueryErrorTest extends AsyncTestCase
|
2018-06-29 19:24:35 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @test
|
|
|
|
*/
|
2018-06-29 19:35:58 +02:00
|
|
|
public function testItPassesQueryAlong()
|
2018-06-29 19:24:35 +02:00
|
|
|
{
|
|
|
|
$error = new QueryError('error', 'SELECT * FROM foo');
|
|
|
|
|
|
|
|
$this->assertSame('SELECT * FROM foo', $error->getQuery());
|
|
|
|
$this->assertStringStartsWith("Amp\Sql\QueryError: error\nCurrent query was SELECT * FROM foo", (string) $error);
|
|
|
|
}
|
2018-06-29 19:41:33 +02:00
|
|
|
}
|