diff --git a/.github/workflows/codeception.yml b/.github/workflows/codeception.yml index e69a354..5f8cfb2 100644 --- a/.github/workflows/codeception.yml +++ b/.github/workflows/codeception.yml @@ -15,12 +15,12 @@ jobs: TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}" PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework" - PIMCORE_CODECEPTION_VERSION: "2.0" + PIMCORE_CODECEPTION_VERSION: "3.0" APP_ENV: test - PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test" + PIMCORE_TEST_DB_DSN: "mysql://test:test@127.0.0.1:3306/dachcom_bundle_test" PIMCORE_TEST_URL: "http://localhost" - PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes/DataObject" + PIMCORE_CLASS_DIRECTORY: "${{ github.workspace }}/lib/test-bundle/tests/_output/var/classes" SYMFONY_DEPRECATIONS_HELPER: "weak" PIMCORE_PHP_ERROR_REPORTING: 32767 @@ -38,12 +38,12 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: matrix: - php: [ 8.1 ] - symfony: [ ^5.4 ] - pimcore: [ ~10.6.0 ] + php: [ 8.2 ] + symfony: [ ^6.2 ] + pimcore: [ ~11.0.0 ] include: - - pimcore: ~10.6.0 - template_tag: v10.2.5 + - pimcore: ~11.0.0 + template_tag: v11.0.0 steps: - uses: actions/checkout@v2 with: @@ -82,9 +82,19 @@ jobs: run: php -v - name: Setup MySql - run: | - sudo systemctl start mysql - mysql -uroot -proot -h127.0.0.1 -e "CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;" + uses: shogo82148/actions-setup-mysql@v1 + with: + mysql-version: '8.0' + user: test + password: test + root-password: root + auto-start: true + my-cnf: | + max_allowed_packet=32505856 + max_connections=1000 + + - name: Initial Database + run: mysql -utest -ptest -h127.0.0.1 -e 'CREATE DATABASE dachcom_bundle_test CHARSET=utf8mb4;' - name: Setup Chromium run: | @@ -115,7 +125,7 @@ jobs: run: | composer config "minimum-stability" "dev" composer config "prefer-stable" true - sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json + sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh ./pimcore-codeception-framework/src/_etc/scripts/composer.sh diff --git a/.github/workflows/ecs.yml b/.github/workflows/ecs.yml index efa8e71..ad03336 100644 --- a/.github/workflows/ecs.yml +++ b/.github/workflows/ecs.yml @@ -15,7 +15,7 @@ jobs: TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}" PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework" - PIMCORE_CODECEPTION_VERSION: "2.0" + PIMCORE_CODECEPTION_VERSION: "3.0" APP_ENV: test PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test" @@ -37,12 +37,12 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: matrix: - php: [ 8.1 ] - symfony: [ ^5.4 ] - pimcore: [ ~10.6.0 ] + php: [ 8.2 ] + symfony: [ ^6.2 ] + pimcore: [ ~11.0.0 ] include: - - pimcore: ~10.6.0 - template_tag: v10.2.5 + - pimcore: ~11.0.0 + template_tag: v11.0.0 steps: - uses: actions/checkout@v2 with: @@ -105,7 +105,7 @@ jobs: run: | composer config "minimum-stability" "dev" composer config "prefer-stable" true - sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json + sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh ./pimcore-codeception-framework/src/_etc/scripts/composer.sh diff --git a/.github/workflows/php-stan.yml b/.github/workflows/php-stan.yml index 4509f7b..091f645 100644 --- a/.github/workflows/php-stan.yml +++ b/.github/workflows/php-stan.yml @@ -15,7 +15,7 @@ jobs: TEST_PROJECT_ROOT_DIR: "${{ github.workspace }}" PIMCORE_CODECEPTION_FRAMEWORK: "${{ github.workspace }}/pimcore-codeception-framework" - PIMCORE_CODECEPTION_VERSION: "2.0" + PIMCORE_CODECEPTION_VERSION: "3.0" APP_ENV: test PIMCORE_TEST_DB_DSN: "mysql://root:root@127.0.0.1:3306/dachcom_bundle_test" @@ -37,12 +37,12 @@ jobs: options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 strategy: matrix: - php: [ 8.1 ] - symfony: [ ^5.4 ] - pimcore: [ ~10.6.0 ] + php: [ 8.2 ] + symfony: [ ^6.2 ] + pimcore: [ ~11.0.0 ] include: - - pimcore: ~10.6.0 - template_tag: v10.2.5 + - pimcore: ~11.0.0 + template_tag: v11.0.0 steps: - uses: actions/checkout@v2 with: @@ -105,7 +105,7 @@ jobs: run: | composer config "minimum-stability" "dev" composer config "prefer-stable" true - sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "2.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json + sed -i 's,\("dachcom-digital\/social-data"\): "\(.*\)",\1: "3.x-dev",g' ${{ github.workspace }}/lib/test-bundle/composer.json chmod +x ./pimcore-codeception-framework/src/_etc/scripts/composer.sh ./pimcore-codeception-framework/src/_etc/scripts/composer.sh diff --git a/LICENSE.md b/LICENSE.md index 0c51434..b1a5fc8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,5 @@ # License -Copyright (C) 2020 DACHCOM.DIGITAL +Copyright (C) 2023 DACHCOM.DIGITAL This software is available under the GNU General Public License version 3 (GPLv3). diff --git a/README.md b/README.md index 9afa809..048b9f3 100644 --- a/README.md +++ b/README.md @@ -12,42 +12,32 @@ This Connector allows you to fetch social posts from LinkedIn. ### Release Plan | Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch | |---------|----------------------------|----------------------------|--------------|----------------|-------------------------------------------------------------------------------------------| -| **2.x** | `10.1` - `10.6` | `5.4` | 05.01.2022 | Feature Branch | master | +| **3.x** | `11.0` | `6.2` | 07.11.2023 | Feature Branch | master | +| **2.x** | `10.1` - `10.6` | `5.4` | 05.01.2022 | Unsupported | [2.x](https://github.com/dachcom-digital/pimcore-social-data-linkedin-connector/tree/2.x) | | **1.x** | `6.0` - `6.9` | `3.4`, `^4.4` | 22.10.2020 | Unsupported | [1.x](https://github.com/dachcom-digital/pimcore-social-data-linkedin-connector/tree/1.x) | ## Installation -### I. Add Dependency ```json "require" : { - "dachcom-digital/social-data" : "~2.0.0", - "dachcom-digital/social-data-linkedin-connector" : "~2.0.0", + "dachcom-digital/social-data" : "~3.0.0", + "dachcom-digital/social-data-linkedin-connector" : "~3.0.0" } ``` -### II. Register Connector Bundle +Add Bundle to `bundles.php`: ```php -// src/Kernel.php -namespace App; - -use Pimcore\HttpKernel\BundleCollection\BundleCollection; - -class Kernel extends \Pimcore\Kernel -{ - public function registerBundlesToCollection(BundleCollection $collection) - { - $collection->addBundle(new SocialData\Connector\LinkedIn\SocialDataLinkedInConnectorBundle()); - } -} +return [ + SocialData\Connector\LinkedIn\SocialDataLinkedInConnectorBundle::class => ['all' => true], +]; ``` -### III. Install Assets +### Install Assets ```bash bin/console assets:install public --relative --symlink ``` ## Enable Connector - ```yaml # config/packages/social_data.yaml social_data: @@ -91,10 +81,10 @@ If everything worked out fine, the connection setup is complete after the popup Otherwise, you'll receive an error message. You may then need to repeat the connection step. ## Feed Configuration -| Name | Description -|------|----------------------| -| `Company ID` | Set company id to fetch posts from | -| `Limit` | Define a limit to restrict the amount of social posts to import (Default: 20) | +| Name | Description | +|--------------|-------------------------------------------------------------------------------| +| `Company ID` | Set company id to fetch posts from | +| `Limit` | Define a limit to restrict the amount of social posts to import (Default: 20) | ## Extended Connector Configuration Normally you don't need to modify connector (`connector_config`) configuration, so most of the time you can skip this step. diff --git a/UPGRADE.md b/UPGRADE.md index 634cf71..857c4ae 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,9 +1,6 @@ # Upgrade Notes -## 2.0.1 -- [BUGFIX] fix assoc array check [#3](https://github.com/dachcom-digital/pimcore-social-data-linkedin-connector/pull/3) -- -## Migrating from Version 1.x to Version 2.0.0 +## Migrating from Version 2.x to Version 3.0.0 ### Global Changes -- PHP8 return type declarations added: you may have to adjust your extensions accordingly +- Recommended folder structure by symfony adopted \ No newline at end of file diff --git a/codeception.dist.yml b/codeception.dist.yml index 882426c..296aad2 100644 --- a/codeception.dist.yml +++ b/codeception.dist.yml @@ -1,14 +1,15 @@ namespace: DachcomBundle\Test +support_namespace: Support actor: Tester paths: tests: tests - output: tests/_output - data: tests/_data - support: tests/_support envs: tests/_envs + output: tests/_output log: tests/_output/var/logs + data: tests/_data + support: tests/Support +bootstrap: _bootstrap.php settings: - bootstrap: _bootstrap.php memory_limit: -1 colors: true params: diff --git a/composer.json b/composer.json index 52c52ea..3c98e35 100755 --- a/composer.json +++ b/composer.json @@ -30,12 +30,12 @@ } }, "require": { - "dachcom-digital/social-data": "^2.0" + "dachcom-digital/social-data": "^3.0" }, "require-dev": { - "codeception/codeception": "^4.1", - "codeception/module-webdriver": "^1.4", - "codeception/module-symfony": "^1.6", + "codeception/codeception": "^5.0", + "codeception/module-symfony": "^3.1", + "codeception/module-webdriver": "^4.0", "phpstan/phpstan": "^1.0", "phpstan/phpstan-symfony": "^1.0", "symplify/easy-coding-standard": "^9.0" diff --git a/src/Resources/config/pimcore/config.yml b/config/pimcore/config.yaml similarity index 100% rename from src/Resources/config/pimcore/config.yml rename to config/pimcore/config.yaml diff --git a/src/Resources/config/pimcore/routing.yml b/config/pimcore/routing.yaml similarity index 100% rename from src/Resources/config/pimcore/routing.yml rename to config/pimcore/routing.yaml diff --git a/src/Resources/config/services.yml b/config/services.yaml similarity index 86% rename from src/Resources/config/services.yml rename to config/services.yaml index 4264967..6e43846 100644 --- a/src/Resources/config/services.yml +++ b/config/services.yaml @@ -37,3 +37,9 @@ services: SocialData\Connector\LinkedIn\Controller\Admin\LinkedInController: tags: [ 'controller.service_arguments' ] + + ## Events + + SocialData\Connector\LinkedIn\EventListener\Admin\AssetListener: + tags: + - { name: kernel.event_subscriber } diff --git a/phpstan.neon b/phpstan.neon index a3133c4..8a06ff8 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,5 +7,5 @@ parameters: symfony: container_xml_path: %currentWorkingDirectory%/var/cache/test/TestKernelTestDebugContainer.xml constant_hassers: false - excludes_analyse: [] + excludePaths: [] ignoreErrors: [] diff --git a/src/Resources/public/css/admin.css b/public/css/admin.css similarity index 100% rename from src/Resources/public/css/admin.css rename to public/css/admin.css diff --git a/src/Resources/public/img/linkedIn.svg b/public/img/linkedIn.svg similarity index 100% rename from src/Resources/public/img/linkedIn.svg rename to public/img/linkedIn.svg diff --git a/src/Resources/public/js/connector/linkedin-connector.js b/public/js/connector/linkedin-connector.js similarity index 100% rename from src/Resources/public/js/connector/linkedin-connector.js rename to public/js/connector/linkedin-connector.js diff --git a/src/Resources/public/js/feed/linkedin-feed.js b/public/js/feed/linkedin-feed.js similarity index 100% rename from src/Resources/public/js/feed/linkedin-feed.js rename to public/js/feed/linkedin-feed.js diff --git a/src/Controller/Admin/LinkedInController.php b/src/Controller/Admin/LinkedInController.php index 1c2e8ef..835892b 100644 --- a/src/Controller/Admin/LinkedInController.php +++ b/src/Controller/Admin/LinkedInController.php @@ -3,7 +3,7 @@ namespace SocialData\Connector\LinkedIn\Controller\Admin; use Carbon\Carbon; -use Pimcore\Bundle\AdminBundle\Controller\AdminController; +use Pimcore\Bundle\AdminBundle\Controller\AdminAbstractController; use SocialData\Connector\LinkedIn\Model\EngineConfiguration; use SocialData\Connector\LinkedIn\Client\LinkedInClient; use SocialDataBundle\Connector\ConnectorDefinitionInterface; @@ -15,7 +15,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\HttpException; -class LinkedInController extends AdminController +class LinkedInController extends AdminAbstractController { use ConnectResponseTrait; diff --git a/src/DependencyInjection/SocialDataLinkedInConnectorExtension.php b/src/DependencyInjection/SocialDataLinkedInConnectorExtension.php index 2ea0351..c981790 100644 --- a/src/DependencyInjection/SocialDataLinkedInConnectorExtension.php +++ b/src/DependencyInjection/SocialDataLinkedInConnectorExtension.php @@ -17,7 +17,7 @@ public function load(array $configs, ContainerBuilder $container): void $configuration = new Configuration(); $this->processConfiguration($configuration, $configs); - $loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../Resources/config'])); - $loader->load('services.yml'); + $loader = new YamlFileLoader($container, new FileLocator([__DIR__ . '/../../config'])); + $loader->load('services.yaml'); } } diff --git a/src/EventListener/Admin/AssetListener.php b/src/EventListener/Admin/AssetListener.php new file mode 100644 index 0000000..b1ccead --- /dev/null +++ b/src/EventListener/Admin/AssetListener.php @@ -0,0 +1,33 @@ + 'addCssFiles', + BundleManagerEvents::JS_PATHS => 'addJsFiles', + ]; + } + + public function addCssFiles(PathsEvent $event): void + { + $event->addPaths([ + '/bundles/socialdatalinkedinconnector/css/admin.css' + ]); + } + + public function addJsFiles(PathsEvent $event): void + { + $event->addPaths([ + '/bundles/socialdatalinkedinconnector/js/connector/linkedin-connector.js', + '/bundles/socialdatalinkedinconnector/js/feed/linkedin-feed.js', + ]); + } +} diff --git a/src/SocialDataLinkedInConnectorBundle.php b/src/SocialDataLinkedInConnectorBundle.php index 76efbaf..87f8998 100644 --- a/src/SocialDataLinkedInConnectorBundle.php +++ b/src/SocialDataLinkedInConnectorBundle.php @@ -2,32 +2,22 @@ namespace SocialData\Connector\LinkedIn; -use Pimcore\Extension\Bundle\AbstractPimcoreBundle; use Pimcore\Extension\Bundle\Traits\PackageVersionTrait; +use Symfony\Component\HttpKernel\Bundle\Bundle; -class SocialDataLinkedInConnectorBundle extends AbstractPimcoreBundle +class SocialDataLinkedInConnectorBundle extends Bundle { use PackageVersionTrait; public const PACKAGE_NAME = 'dachcom-digital/social-data-linkedin-connector'; - protected function getComposerPackageName(): string + public function getPath(): string { - return self::PACKAGE_NAME; + return \dirname(__DIR__); } - public function getCssPaths(): array - { - return [ - '/bundles/socialdatalinkedinconnector/css/admin.css' - ]; - } - - public function getJsPaths(): array + protected function getComposerPackageName(): string { - return [ - '/bundles/socialdatalinkedinconnector/js/connector/linkedin-connector.js', - '/bundles/socialdatalinkedinconnector/js/feed/linkedin-feed.js', - ]; + return self::PACKAGE_NAME; } } diff --git a/tests/Functional.suite.dist.yml b/tests/Functional.suite.dist.yml new file mode 100644 index 0000000..3b28e68 --- /dev/null +++ b/tests/Functional.suite.dist.yml @@ -0,0 +1,12 @@ +actor: FunctionalTester +modules: + enabled: + - \Dachcom\Codeception\Support\Helper\PimcoreCore: + connect_db: true + rebootable_client: true + - \Dachcom\Codeception\Support\Helper\PimcoreBundleCore: + run_installer: true + - \Dachcom\Codeception\Support\Helper\Browser\PhpBrowser: + depends: \Dachcom\Codeception\Support\Helper\PimcoreCore + - \Dachcom\Codeception\Support\Helper\PimcoreBackend + - \Dachcom\Codeception\Support\Helper\PimcoreUser diff --git a/tests/functional/_bootstrap.php b/tests/Functional/_bootstrap.php similarity index 100% rename from tests/functional/_bootstrap.php rename to tests/Functional/_bootstrap.php diff --git a/tests/Support/FunctionalTester.php b/tests/Support/FunctionalTester.php new file mode 100644 index 0000000..80598b8 --- /dev/null +++ b/tests/Support/FunctionalTester.php @@ -0,0 +1,8 @@ +getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeException', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @param string $exception + * @param string $message + * @param \Closure $callback + * @see \Dachcom\Codeception\Helper\PimcoreCore::seeException() + */ + public function seeException($exception, $message, $callback) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeException', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Actor Function to boot symfony with a specific bundle configuration + * + * @param string $configuration + * @see \Dachcom\Codeception\Helper\PimcoreCore::haveABootedSymfonyConfiguration() + */ + public function haveABootedSymfonyConfiguration($configuration) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveABootedSymfonyConfiguration', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @return Pimcore|Module + * @see \Pimcore\Tests\Helper\Pimcore::getPimcoreModule() + */ + public function getPimcoreModule() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('getPimcoreModule', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @return \Symfony\Component\HttpKernel\Kernel|Kernel + * @see \Pimcore\Tests\Helper\Pimcore::getKernel() + */ + public function getKernel() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('getKernel', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * @return \Symfony\Component\DependencyInjection\ContainerInterface + * @see \Pimcore\Tests\Helper\Pimcore::getContainer() + */ + public function getContainer() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('getContainer', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Set pimcore into admin state + * @see \Pimcore\Tests\Helper\Pimcore::setAdminMode() + */ + public function setAdminMode() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('setAdminMode', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Set pimcore into non-admin state + * @see \Pimcore\Tests\Helper\Pimcore::unsetAdminMode() + */ + public function unsetAdminMode() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('unsetAdminMode', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Get service $serviceName and add it to the lists of persistent services. + * If $isPermanent then service becomes persistent between tests + * + * @param string $serviceName + * @param boolean $isPermanent + * @see \Codeception\Module\Symfony::persistService() + */ + public function persistService($serviceName, $isPermanent = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('persistService', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Remove service $serviceName from the lists of persistent services. + * + * @param string $serviceName + * @see \Codeception\Module\Symfony::unpersistService() + */ + public function unpersistService($serviceName) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('unpersistService', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Invalidate previously cached routes. + * @see \Codeception\Module\Symfony::invalidateCachedRouter() + */ + public function invalidateCachedRouter() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('invalidateCachedRouter', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Opens web page using route name and parameters. + * + * ``` php + * amOnRoute('posts.create'); + * $I->amOnRoute('posts.show', array('id' => 34)); + * ?> + * ``` + * + * @param $routeName + * @param array $params + * @see \Codeception\Module\Symfony::amOnRoute() + */ + public function amOnRoute($routeName, $params = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnRoute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current url matches route. + * + * ``` php + * seeCurrentRouteIs('posts.index'); + * $I->seeCurrentRouteIs('posts.show', array('id' => 8)); + * ?> + * ``` + * + * @param $routeName + * @param array $params + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Symfony::seeCurrentRouteIs() + */ + public function canSeeCurrentRouteIs($routeName, $params = null) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeCurrentRouteIs', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current url matches route. + * + * ``` php + * seeCurrentRouteIs('posts.index'); + * $I->seeCurrentRouteIs('posts.show', array('id' => 8)); + * ?> + * ``` + * + * @param $routeName + * @param array $params + * @see \Codeception\Module\Symfony::seeCurrentRouteIs() + */ + public function seeCurrentRouteIs($routeName, $params = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeCurrentRouteIs', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current url matches route. + * Unlike seeCurrentRouteIs, this can matches without exact route parameters + * + * ``` php + * seeCurrentRouteMatches('my_blog_pages'); + * ?> + * ``` + * + * @param $routeName + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Symfony::seeInCurrentRoute() + */ + public function canSeeInCurrentRoute($routeName) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeInCurrentRoute', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that current url matches route. + * Unlike seeCurrentRouteIs, this can matches without exact route parameters + * + * ``` php + * seeCurrentRouteMatches('my_blog_pages'); + * ?> + * ``` + * + * @param $routeName + * @see \Codeception\Module\Symfony::seeInCurrentRoute() + */ + public function seeInCurrentRoute($routeName) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeInCurrentRoute', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if the desired number of emails was sent. + * If no argument is provided then at least one email must be sent to satisfy the check. + * + * ``` php + * seeEmailIsSent(2); + * ?> + * ``` + * + * @param null|int $expectedCount + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Symfony::seeEmailIsSent() + */ + public function canSeeEmailIsSent($expectedCount = null) { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('seeEmailIsSent', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks if the desired number of emails was sent. + * If no argument is provided then at least one email must be sent to satisfy the check. + * + * ``` php + * seeEmailIsSent(2); + * ?> + * ``` + * + * @param null|int $expectedCount + * @see \Codeception\Module\Symfony::seeEmailIsSent() + */ + public function seeEmailIsSent($expectedCount = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('seeEmailIsSent', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that no email was sent. This is an alias for seeEmailIsSent(0). + * + * @part email + * Conditional Assertion: Test won't be stopped on fail + * @see \Codeception\Module\Symfony::dontSeeEmailIsSent() + */ + public function cantSeeEmailIsSent() { + return $this->getScenario()->runStep(new \Codeception\Step\ConditionalAssertion('dontSeeEmailIsSent', func_get_args())); + } + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that no email was sent. This is an alias for seeEmailIsSent(0). + * + * @part email + * @see \Codeception\Module\Symfony::dontSeeEmailIsSent() + */ + public function dontSeeEmailIsSent() { + return $this->getScenario()->runStep(new \Codeception\Step\Assertion('dontSeeEmailIsSent', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Grabs a service from Symfony DIC container. + * Recommended to use for unit testing. + * + * ``` php + * grabServiceFromContainer('doctrine'); + * ?> + * ``` + * + * @param $service + * @return mixed + * @part services + * @deprecated Use grabService instead + * @see \Codeception\Module\Symfony::grabServiceFromContainer() + */ + public function grabServiceFromContainer($service) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('grabServiceFromContainer', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Grabs a service from Symfony DIC container. + * Recommended to use for unit testing. + * + * ``` php + * grabService('doctrine'); + * ?> + * ``` + * + * @param $service + * @return mixed + * @part services + * @see \Codeception\Module\Symfony::grabService() + */ + public function grabService($service) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('grabService', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Reboot client's kernel. + * Can be used to manually reboot kernel when 'rebootable_client' => false + * + * ``` php + * rebootClientKernel(); + * ... + * perform other requests + * ... + * + * ?> + * ``` + * + * @see \Codeception\Module\Symfony::rebootClientKernel() + */ + public function rebootClientKernel() { + return $this->getScenario()->runStep(new \Codeception\Step\Action('rebootClientKernel', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Authenticates user for HTTP_AUTH + * + * @param $username + * @param $password + * @see \Codeception\Lib\InnerBrowser::amHttpAuthenticated() + */ + public function amHttpAuthenticated($username, $password) { + return $this->getScenario()->runStep(new \Codeception\Step\Condition('amHttpAuthenticated', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Sets the HTTP header to the passed value - which is used on + * subsequent HTTP requests through PhpBrowser. + * + * Example: + * ```php + * haveHttpHeader('X-Requested-With', 'Codeception'); + * $I->amOnPage('test-headers.php'); + * ?> + * ``` + * + * To use special chars in Header Key use HTML Character Entities: + * Example: + * Header with underscore - 'Client_Id' + * should be represented as - 'Client_Id' or 'Client_Id' + * + * ```php + * haveHttpHeader('Client_Id', 'Codeception'); + * ?> + * ``` + * + * @param string $name the name of the request header + * @param string $value the value to set it to for subsequent + * requests + * @see \Codeception\Lib\InnerBrowser::haveHttpHeader() + */ + public function haveHttpHeader($name, $value) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('haveHttpHeader', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Deletes the header with the passed name. Subsequent requests + * will not have the deleted header in its request. + * + * Example: + * ```php + * haveHttpHeader('X-Requested-With', 'Codeception'); + * $I->amOnPage('test-headers.php'); + * // ... + * $I->deleteHeader('X-Requested-With'); + * $I->amOnPage('some-other-page.php'); + * ?> + * ``` + * + * @param string $name the name of the header to delete. + * @see \Codeception\Lib\InnerBrowser::deleteHeader() + */ + public function deleteHeader($name) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('deleteHeader', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Opens the page for the given relative URI. + * + * ``` php + * amOnPage('/'); + * // opens /register page + * $I->amOnPage('/register'); + * ``` + * + * @param string $page + * @see \Codeception\Lib\InnerBrowser::amOnPage() + */ + public function amOnPage($page) { + return $this->getScenario()->runStep(new \Codeception\Step\Condition('amOnPage', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Perform a click on a link or a button, given by a locator. + * If a fuzzy locator is given, the page will be searched for a button, link, or image matching the locator string. + * For buttons, the "value" attribute, "name" attribute, and inner text are searched. + * For links, the link text is searched. + * For images, the "alt" attribute and inner text of any parent links are searched. + * + * The second parameter is a context (CSS or XPath locator) to narrow the search. + * + * Note that if the locator matches a button of type `submit`, the form will be submitted. + * + * ``` php + * click('Logout'); + * // button of form + * $I->click('Submit'); + * // CSS button + * $I->click('#form input[type=submit]'); + * // XPath + * $I->click('//form/*[@type=submit]'); + * // link in context + * $I->click('Logout', '#nav'); + * // using strict locator + * $I->click(['link' => 'Login']); + * ?> + * ``` + * + * @param $link + * @param $context + * @see \Codeception\Lib\InnerBrowser::click() + */ + public function click($link, $context = null) { + return $this->getScenario()->runStep(new \Codeception\Step\Action('click', func_get_args())); + } + + + /** + * [!] Method is generated. Documentation taken from corresponding module. + * + * Checks that the current page contains the given string (case insensitive). + * + * You can specify a specific HTML element (via CSS or XPath) as the second + * parameter to only search within that element. + * + * ``` php + * see('Logout'); // I can suppose user is logged in + * $I->see('Sign Up', 'h1'); // I can suppose it's a signup page + * $I->see('Sign Up', '//body/h1'); // with XPath + * $I->see('Sign Up', ['css' => 'body h1']); // with strict CSS locator + * ``` + * + * Note that the search is done after stripping all HTML tags from the body, + * so `$I->see('strong')` will return true for strings like: + * + * - `
I am Stronger than thou
` + * - `` + * + * But will *not* be true for strings like: + * + * - `Home` + * - `I am Stronger than thou
` + * - `` + * + * But will *not* be true for strings like: + * + * - `Home` + * - `I am Stronger than thou
` + * - `` + * + * But will ignore strings like: + * + * - `Home` + * - `I am Stronger than thou
` + * - `` + * + * But will ignore strings like: + * + * - `Home` + * - `