Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to symfony 6.4 #3

Closed
wants to merge 33 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2ddc826
upgrade to symfony 6.3
hbagherzadegan Jul 24, 2023
55e6195
Initial commit
pamil Jul 22, 2016
5c89306
SymfonyExtension v2.0: proof of concept
pamil Dec 19, 2018
18b7c38
Rename kernel rebooter
pamil Jan 10, 2019
2ce90c5
Implement kernel autodiscovering
pamil Jan 10, 2019
4cf76b4
Implement bootstrap file autodiscovering
pamil Jan 10, 2019
c19c590
Add tests for context initializers
pamil Feb 12, 2019
2247e0f
Add more sanity checks
pamil Feb 12, 2019
d582782
Refactor our environment handler to decorate the original one
pamil Feb 12, 2019
b67d770
Apply suggestions from code review
alanpoulain Feb 13, 2019
3e826a2
Expose the Mink service
pamil Feb 13, 2019
f55263c
Allow accessing a context in another context
pamil Mar 4, 2019
25c60ec
Fix bug preventing changes of Mink default session service
pamil Mar 15, 2019
4c3e2dc
Hotfix for weird bug in Sylius
pamil Mar 17, 2019
67ed4b7
Initialize contexts registered as services
pamil Mar 21, 2019
1cd534c
Provide simple BrowserKit integration
pamil May 17, 2019
e80efb8
Generate changelog for v2.1.0-BETA.1
pamil Jan 15, 2020
769a0bc
Describe accessing driver's service container
pamil Apr 4, 2020
cf03b50
Generate changelog for v2.0.11
pamil Apr 4, 2020
ec3ef43
Replace PHPStan with Psalm
pamil Apr 4, 2020
5cdf5f3
upgrade to symfony 6.3
hbagherzadegan Jul 24, 2023
0704836
SymfonyExtension v2.0: proof of concept
pamil Dec 19, 2018
59c7d55
Rename kernel rebooter
pamil Jan 10, 2019
975cfa0
Add tests for context initializers
pamil Feb 12, 2019
36d73c7
Add more sanity checks
pamil Feb 12, 2019
db0a1d1
Refactor our environment handler to decorate the original one
pamil Feb 12, 2019
2c331f6
Apply suggestions from code review
alanpoulain Feb 13, 2019
3b202d4
upgrade to symfony 6.3
hbagherzadegan Jul 25, 2023
9c7fb2e
- update README.md
hbagherzadegan Jul 25, 2023
3de3afa
upgrade-to-symfony-6.4
hbagherzadegan Jan 4, 2024
1261584
upgrade-to-symfony-6.4
hbagherzadegan Jan 4, 2024
014758e
upgrade-to-symfony-6.4
hbagherzadegan Jan 4, 2024
33a90f7
- update rector to 0.19.2
hbagherzadegan Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Initial commit
pamil authored and hbagherzadegan committed Jul 25, 2023
commit 55e619599332059eca29de27f21791c0a77ade2f
5 changes: 0 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
/features export-ignore
/tests export-ignore

/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/behat.yml.dist export-ignore
/easy-coding-standard.yml export-ignore
/phpstan.neon export-ignore
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: php

php:
- 7.0
- 5.6

env:
global:
- COMPOSER_OPTIONS=""

matrix:
include:
-
php: 5.6
env: COMPOSER_OPTIONS="--prefer-lowest"

cache:
directories:
- vendor

before_install:
- phpenv config-rm xdebug.ini || true

- composer self-update

install:
- composer update --prefer-dist $COMPOSER_OPTIONS

script:
- composer validate --strict

- vendor/bin/behat --strict
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016-2019 Kamil Kokot
Copyright (c) 2016 Kamil Kokot

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
6 changes: 2 additions & 4 deletions behat.yml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
default:
suites:
default:
contexts:
- Tests\Behat\Context\TestContext
extensions:
FriendsOfBehat\SymfonyExtension: ~
45 changes: 31 additions & 14 deletions src/Driver/Factory/SymfonyDriverFactory.php
Original file line number Diff line number Diff line change
@@ -1,50 +1,67 @@
<?php

declare(strict_types=1);

namespace FriendsOfBehat\SymfonyExtension\Driver\Factory;

use Behat\Mink\Driver\BrowserKitDriver;
use Behat\MinkExtension\ServiceContainer\Driver\DriverFactory;
use FriendsOfBehat\SymfonyExtension\Driver\SymfonyDriver;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

/**
* @author Kamil Kokot <kamil@kokot.me>
*/
final class SymfonyDriverFactory implements DriverFactory
{
/** @var string */
/**
* @var string
*/
private $name;

/** @var Reference */
/**
* @var Reference
*/
private $kernel;

public function __construct(string $name, Reference $kernel)
/**
* @param string $name
* @param Reference $kernel
*/
public function __construct($name, Reference $kernel)
{
$this->name = $name;
$this->kernel = $kernel;
}

public function getDriverName(): string
/**
* {@inheritdoc}
*/
public function getDriverName()
{
return $this->name;
}

public function supportsJavascript(): bool
/**
* {@inheritdoc}
*/
public function supportsJavascript()
{
return false;
}

public function configure(ArrayNodeDefinition $builder): void
/**
* {@inheritdoc}
*/
public function configure(ArrayNodeDefinition $builder)
{

}

public function buildDriver(array $config): Definition
/**
* {@inheritdoc}
*/
public function buildDriver(array $config)
{
if (!class_exists(BrowserKitDriver::class)) {
throw new \RuntimeException('Install "friends-of-behat/mink-browserkit-driver" (drop-in replacement for "behat/mink-browserkit-driver") in order to use the "symfony" driver.');
}

return new Definition(SymfonyDriver::class, [
$this->kernel,
'%mink.base_url%',
44 changes: 44 additions & 0 deletions src/Listener/KernelRebooter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace FriendsOfBehat\SymfonyExtension\Listener;

use Behat\Behat\EventDispatcher\Event\ExampleTested;
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelInterface;

/**
* @author Kamil Kokot <kamil@kokot.me>
*/
final class KernelRebooter implements EventSubscriberInterface
{
/**
* @var KernelInterface
*/
private $kernel;

/**
* @param KernelInterface $kernel
*/
public function __construct(KernelInterface $kernel)
{
$this->kernel = $kernel;
}

/**
* {@inheritdoc}
*/
public static function getSubscribedEvents()
{
return [
ScenarioTested::AFTER => ['rebootKernel', -15],
ExampleTested::AFTER => ['rebootKernel', -15],
];
}

public function rebootKernel()
{
$this->kernel->shutdown();
$this->kernel->boot();
}
}