3 namespace Doctrine\Tests\DBAL\Platforms;
5 use Doctrine\DBAL\Platforms\Keywords\ReservedKeywordsValidator;
6 use Doctrine\DBAL\Schema\Table;
7 use Doctrine\DBAL\Schema\Column;
8 use Doctrine\DBAL\Types\Type;
10 class ReservedKeywordsValidatorTest extends \Doctrine\Tests\DbalTestCase
13 * @var ReservedKeywordsValidator
17 public function setUp()
19 $this->validator = new ReservedKeywordsValidator(array(
20 new \Doctrine\DBAL\Platforms\Keywords\MySQLKeywords()
24 public function testReservedTableName()
26 $table = new Table("TABLE");
27 $this->validator->acceptTable($table);
30 array('Table TABLE keyword violations: MySQL'),
31 $this->validator->getViolations()
35 public function testReservedColumnName()
37 $table = new Table("TABLE");
38 $column = $table->addColumn('table', 'string');
40 $this->validator->acceptColumn($table, $column);
43 array('Table TABLE column table keyword violations: MySQL'),
44 $this->validator->getViolations()