PHP code example of pavlakis / slim-behat-extension

1. Go to this page and download the library: Download pavlakis/slim-behat-extension library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pavlakis / slim-behat-extension example snippets





use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;

use Pavlakis\Slim\Behat\Context\App;
use Pavlakis\Slim\Behat\Context\KernelAwareContext;

class FeatureContext implements Context, KernelAwareContext
{
   use App;

    /**
     * @Then it works
     */

    public function itWorks()
   {
       /** @var \Psr\Log\LoggerInterface $logger */
       $logger = $this->app->getContainer()->get('logger');
       $logger->info("Slim-behat integration works!");
   }

    /**
     * @Given I load the slim-behat extension
     */
    public function iLoadTheSlimBehatExtension()
    {
    }
}


use Behat\Behat\Context\Context;

use Behat\MinkExtension\Context\MinkContext;
use Pavlakis\Slim\Behat\Context\App;
use Pavlakis\Slim\Behat\Context\KernelAwareContext;

/**
 * Defines application features from the specific context.
 */
class FeatureContext extends MinkContext implements Context, KernelAwareContext
{
    use App;
}



$this->app->getContainer()

yml

default:
  suites:
    default:
      contexts:
        - FeatureContext

  extensions:
    Pavlakis\Slim\Behat:
      config_file: app/settings.php
      dependencies_file: app/dependencies.php
      

      config_file: ../../app/configs/settings_test.php
      dependencies_file: ../../app/dependencies.php
      middleware_file: ../../middleware.php
      routes_file: ../../routes.php