sql/test/QueryErrorTest.php

21 lines
465 B
PHP
Raw Permalink Normal View History

2018-06-29 19:24:35 +02:00
<?php
namespace Amp\Sql\Test;
use Amp\PHPUnit\TestCase;
use Amp\Sql\QueryError;
class QueryErrorTest extends TestCase
{
/**
* @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
}