diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2019-12-16 16:08:16 -0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2019-12-16 16:08:16 -0300 |
commit | 2ce3ddecec1721a494a2557a9e628e6142fbe5c6 (patch) | |
tree | c3f19585aaeaa4cbee4b6bd5c6c345793dad7239 /tests/Components | |
parent | fa8b1dd561e954c75015f8c7745b3d8713342d94 (diff) | |
download | sql-parser-2ce3ddecec1721a494a2557a9e628e6142fbe5c6.zip sql-parser-2ce3ddecec1721a494a2557a9e628e6142fbe5c6.tar.gz sql-parser-2ce3ddecec1721a494a2557a9e628e6142fbe5c6.tar.bz2 |
Add PHPStan at level 2
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'tests/Components')
-rw-r--r-- | tests/Components/ArrayObjTest.php | 5 | ||||
-rw-r--r-- | tests/Components/CreateDefinitionTest.php | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/Components/ArrayObjTest.php b/tests/Components/ArrayObjTest.php index 978b249..f683d72 100644 --- a/tests/Components/ArrayObjTest.php +++ b/tests/Components/ArrayObjTest.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace PhpMyAdmin\SqlParser\Tests\Components; use PhpMyAdmin\SqlParser\Components\ArrayObj; +use PhpMyAdmin\SqlParser\Components\Expression; use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\Tests\TestCase; @@ -27,12 +28,14 @@ class ArrayObjTest extends TestCase new Parser(), $this->getTokensList('(1 + 2, 3 + 4)'), [ - 'type' => 'PhpMyAdmin\\SqlParser\\Components\\Expression', + 'type' => Expression::class, 'typeOptions' => [ 'breakOnParentheses' => true, ], ] ); + $this->assertInstanceOf(Expression::class, $components[0]); + $this->assertInstanceOf(Expression::class, $components[1]); $this->assertEquals($components[0]->expr, '1 + 2'); $this->assertEquals($components[1]->expr, '3 + 4'); } diff --git a/tests/Components/CreateDefinitionTest.php b/tests/Components/CreateDefinitionTest.php index a1f50b8..d0718c8 100644 --- a/tests/Components/CreateDefinitionTest.php +++ b/tests/Components/CreateDefinitionTest.php @@ -5,6 +5,7 @@ namespace PhpMyAdmin\SqlParser\Tests\Components; use PhpMyAdmin\SqlParser\Components\CreateDefinition; use PhpMyAdmin\SqlParser\Parser; +use PhpMyAdmin\SqlParser\Statements\CreateStatement; use PhpMyAdmin\SqlParser\Tests\TestCase; class CreateDefinitionTest extends TestCase @@ -59,6 +60,7 @@ class CreateDefinitionTest extends TestCase 'CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE' . ') ENGINE=InnoDB"' ); + $this->assertInstanceOf(CreateStatement::class, $parser->statements[0]); $this->assertEquals( 'CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE', CreateDefinition::build($parser->statements[0]->fields[1]) @@ -75,6 +77,7 @@ class CreateDefinitionTest extends TestCase 'CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE' . ') ENGINE=InnoDB"' ); + $this->assertInstanceOf(CreateStatement::class, $parser->statements[0]); $this->assertEquals( 'CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE', CreateDefinition::build($parser->statements[0]->fields[2]) |