diff --git a/.gitignore b/.gitignore
index 7579f74..4a45ef5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
vendor
composer.lock
+.php_cs.cache
diff --git a/README.md b/README.md
index c37a19f..e80ab8e 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,14 @@
# Symfony Psalm Plugin
+[![Build Status](https://travis-ci.com/seferov/symfony-psalm-plugin.svg?branch=master)](https://travis-ci.com/seferov/symfony-psalm-plugin)
+
### Installation
```
composer require --dev seferov/symfony-psalm-plugin
vendor/bin/psalm-plugin enable seferov/symfony-psalm-plugin
```
+
+### Credits
+
+- [@weirdan](https://github.com/weirdan) for [codeception psalm module](https://github.com/weirdan/codeception-psalm-module)
diff --git a/codeception.yml b/codeception.yml
new file mode 100644
index 0000000..e51bc3b
--- /dev/null
+++ b/codeception.yml
@@ -0,0 +1,14 @@
+namespace: Psalm\PhpUnitPlugin\Tests
+
+paths:
+ tests: tests
+ output: tests/_output
+ data: tests/_data
+ support: tests/_support
+ envs: tests/_envs
+
+actor_suffix: Tester
+
+extensions:
+ enabled:
+ - Codeception\Extension\RunFailed
diff --git a/composer.json b/composer.json
index eb73cae..b7ecf2e 100644
--- a/composer.json
+++ b/composer.json
@@ -2,11 +2,6 @@
"name": "seferov/symfony-psalm-plugin",
"description": "Psalm Plugin for Symfony",
"type": "psalm-plugin",
- "require": {
- "php": "^7.1",
- "vimeo/psalm": "^3.2",
- "symfony/framework-bundle": "^3.0 || ^4.0"
- },
"license": "MIT",
"authors": [
{
@@ -14,11 +9,25 @@
"email": "farhad.safarov@gmail.com"
}
],
+ "require": {
+ "php": "^7.1",
+ "vimeo/psalm": "^3.2",
+ "symfony/framework-bundle": "^3.0 || ^4.0"
+ },
+ "require-dev": {
+ "codeception/base": "^2.5",
+ "weirdan/codeception-psalm-module": "^0.2.2"
+ },
"autoload": {
"psr-4": {
"Seferov\\SymfonyPsalmPlugin\\": "src"
}
},
+ "autoload-dev": {
+ "psr-4": {
+ "Seferov\\SymfonyPsalmPlugin\\Tests\\": ["tests/_support"]
+ }
+ },
"extra": {
"psalm" : {
"pluginClass": "Seferov\\SymfonyPsalmPlugin\\Plugin"
@@ -26,8 +35,13 @@
},
"scripts": {
"check": [
- "@analyze"
+ "@analyze",
+ "@test"
],
- "analyze": "psalm"
+ "analyze": "psalm",
+ "test": [
+ "codecept build",
+ "codecept run -v"
+ ]
}
}
diff --git a/tests/_output/.gitignore b/tests/_output/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/tests/_output/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/tests/_run/.gitignore b/tests/_run/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/tests/_run/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/tests/_support/AcceptanceTester.php b/tests/_support/AcceptanceTester.php
new file mode 100644
index 0000000..715352a
--- /dev/null
+++ b/tests/_support/AcceptanceTester.php
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+ """
+
+ Scenario: Asserting container dependency raises issue
+ Given I have the following code
+ """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+ Scenario: Asserting using 'AppBundle:Entity' syntax raises issue
+ Given I have the following code
+ """
+ getRepository('AppBundle:Entity');
+ }
+ }
+
+ namespace Doctrine\ORM;
+ interface EntityManagerInterface
+ {
+ /**
+ * @param string $className
+ *
+ * @return void
+ */
+ public function getRepository($className);
+ }
+ """
+ When I run Psalm
+ Then I see these errors
+ | Type | Message |
+ | RepositoryStringShortcut | Use Entity::class syntax instead |
+ And I see no other errors