<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dylan Ballandras</title>
    <description>The latest articles on DEV Community by Dylan Ballandras (@kayneth).</description>
    <link>https://dev.to/kayneth</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F117730%2Fa1840d93-e45a-4dfe-8dc7-7425a320c912.jpg</url>
      <title>DEV Community: Dylan Ballandras</title>
      <link>https://dev.to/kayneth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kayneth"/>
    <language>en</language>
    <item>
      <title>Use Docker to quickly start projects</title>
      <dc:creator>Dylan Ballandras</dc:creator>
      <pubDate>Wed, 19 Aug 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/kayneth/use-docker-to-quickly-start-projects-1jj3</link>
      <guid>https://dev.to/kayneth/use-docker-to-quickly-start-projects-1jj3</guid>
      <description>&lt;p&gt;I just installed WSL2 on my computer with an pristine Ubuntu 20.04 installationand I didn’t want to install most of languages and software I would use for my projects.&lt;/p&gt;

&lt;p&gt;Then, I forced myself to use &lt;code&gt;docker run --rm&lt;/code&gt; as much as possible.&lt;/p&gt;

&lt;p&gt;Here are a few example for some type of projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing and running Node/NPM based projects
&lt;/h2&gt;

&lt;p&gt;Imagine running a &lt;a href="https://www.snowpack.dev/"&gt;&lt;code&gt;Snowpack&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://www.gatsbyjs.com/"&gt;&lt;code&gt;Gatsby&lt;/code&gt;&lt;/a&gt; based project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;docker run --rm -it -v $PWD:/usr/src/app -w /usr/src/app node:12 yarn install&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker run --rm -it -p 8000:8000 -v $PWD:/usr/src/app -w /usr/src/app node:12 yarn start&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Running a PHP project
&lt;/h2&gt;

&lt;p&gt;You could even &lt;code&gt;composer create&lt;/code&gt;, &lt;code&gt;composer install&lt;/code&gt; or &lt;code&gt;php -S 0.0.0.0:80 -t public&lt;/code&gt; a Symfony project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;docker run --rm --interactive --tty --volume $PWD:/app composer create-project sylius/sylius-standard acme&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker run --rm --interactive --tty --volume $PWD:/app composer install&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docker run -it --rm -p 8000:8000 -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:7.4-cli php -S 0.0.0.0:8000 -t public&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep track of your scripts
&lt;/h2&gt;

&lt;p&gt;You can leverage a Makefile or Shell script to commit those scripts.&lt;/p&gt;

&lt;p&gt;As an example, for my blog, I use the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
.DEFAULT\_GOAL := help

.SILENT: help

path := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE\_LIST)))))

app@install:

    docker run --rm -it -v ${path}:/usr/src/app -w /usr/src/app node:12 yarn install

app@run:

    docker run --rm -it -p 8000:8000 -v ${path}:/usr/src/app -w /usr/src/app node:12 yarn develop --host=0.0.0.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Thank to that, I can try the next Node versions before pushing to production.&lt;/p&gt;

&lt;p&gt;You can find how to easily do the same for any type of language by going to the &lt;a href="https://hub.docker.com/"&gt;https://hub.docker.com/&lt;/a&gt;.There is often a &lt;code&gt;Run a single script&lt;/code&gt; part for the main Docker images.&lt;/p&gt;

&lt;p&gt;Then, if you need to go further, using &lt;code&gt;docker-compose&lt;/code&gt; seems to be interesting to create a “network” of container (eg. add a database, a mailcatcher, etc.).&lt;/p&gt;

&lt;p&gt;Sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nodejs/docker-node"&gt;https://github.com/nodejs/docker-node&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/_/php"&gt;https://hub.docker.com/_/php&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>docker</category>
      <category>php</category>
      <category>node</category>
    </item>
    <item>
      <title>Add Quality assurance tools to a legacy project</title>
      <dc:creator>Dylan Ballandras</dc:creator>
      <pubDate>Thu, 06 Feb 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/kayneth/add-quality-assurance-tools-to-a-legacy-project-lm</link>
      <guid>https://dev.to/kayneth/add-quality-assurance-tools-to-a-legacy-project-lm</guid>
      <description>&lt;h2&gt;
  
  
  The story
&lt;/h2&gt;

&lt;p&gt;It’s often difficult to make others agree on removing unused code, enhance code quality or simply add tooling or methodology.Here’s a adapted story from a real case.&lt;/p&gt;

&lt;p&gt;I joined a project which I had to maintain. There were different people who worked on it. Without maintained unit tests, code style processor or static analyser.They didn’t use a lot of type hinting or update PHPDoc on a PHP 7.1 project. It was total chaos. 😱&lt;/p&gt;

&lt;p&gt;I found it really hard to debug, trace errors and to add features without breaking everything.Then, I first tried to rewrite a lot of things, added &lt;strong&gt;PHPStan&lt;/strong&gt; , more &lt;strong&gt;PHPUnit tests&lt;/strong&gt; , &lt;strong&gt;Behat scenarios&lt;/strong&gt; and opened a PR. It wasn’t welcomed and closed directly.&lt;/p&gt;

&lt;p&gt;Other devs here didn’t want to make the code better for the current version but only wanted to negociate a total rewrite of the app.So my proposal wasn’t helpful to them as it would prove it could be maintain and enhance.&lt;/p&gt;

&lt;p&gt;But everyone in the company knows that management would never have wanted a rewrite. The project still works. One thing they, as manager, don’t actually see is:They lose a lot of money everytime someone spend time debugging manually, testing manually and everyting.Another thing the team doesn’t want to understand is that they would spend too much time and make their company lose a lot of money too if they would go to the full rewrite path.&lt;/p&gt;

&lt;p&gt;Then, &lt;strong&gt;&lt;em&gt;from my point of view&lt;/em&gt;&lt;/strong&gt; , the best way to get both parties to agree was to incrementally update.This time not by hand! There is a bunch of tools out there developed in Open Source and we’ve got a Gitlab CI environment ready.It was time to use it to prove what was needed to improve, rewrite, delete.&lt;/p&gt;

&lt;p&gt;For the management team, you need &lt;strong&gt;numbers&lt;/strong&gt; , &lt;strong&gt;cost informations&lt;/strong&gt; , but most importantly 💲.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How much would it cost? 💸&lt;/li&gt;
&lt;li&gt;How much will we earn? 💰&lt;/li&gt;
&lt;li&gt;How much time will you need? ⏲&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is already &lt;a href="https://thevaluable.dev/code-quality-check-tools-php/#quick-reference"&gt;some good lists for QA&lt;/a&gt; so I will not be exhaustive but only talk about the current tools i’m working with.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add tools through composer
&lt;/h2&gt;

&lt;p&gt;We will use different types of tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coding Standards&lt;/li&gt;
&lt;li&gt;Static Analysis&lt;/li&gt;
&lt;li&gt;A Copy/Paste Detector (CPD) for PHP code.&lt;/li&gt;
&lt;li&gt;A mess detector &lt;/li&gt;
&lt;li&gt;A tool for quickly measuring the size of a PHP project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add them to composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;composer require &lt;span class="nt"&gt;--dev&lt;/span&gt; sylius-labs/coding-standard phpstan/phpstan sebastian/phpcpd phpmd/phpmd phploc/phploc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add scripts to your &lt;code&gt;composer.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"code-style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"vendor/bin/ecs check $(git diff --name-only --diff-filter=ACMRTUXB HEAD~..HEAD -- '*.php')"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"code-style-fix"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"@code-style --fix"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"static-analysis"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"vendor/bin/phpstan analyse $(git diff --name-only --diff-filter=ACMRTUXB HEAD~..HEAD -- '*.php') -c phpstan.neon"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"mess-detector"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"vendor/bin/phpmd $(git diff --numstat --name-only --diff-filter=ACMRTUXB HEAD~..HEAD -- '*.php' | awk -vORS=, '{ print $1 }' | sed 's/,$//') text unusedcode,cleancode,controversial,design"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Start with examples
&lt;/h2&gt;

&lt;p&gt;In each of the next commits, you will use those scripts to make adjustments.Thanks to &lt;code&gt;git diff --name-only --diff-filter=ACMRTUXB HEAD~..HEAD -- '*.php&lt;/code&gt; you will only see errors for files youchanged.&lt;/p&gt;

&lt;p&gt;Work as usual and run commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
$ composer code-style

$ composer code-style-fix

$ composer static-analysis -- --level max # start from 0 then upgrade the level toward 8.

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will only make small changes. Your team will not be able to disagree to thoses improvements.They will see &lt;strong&gt;benefits&lt;/strong&gt; in using your new tools.&lt;/p&gt;

&lt;p&gt;Beware of one thing when using the EasyCodingStandard rules from Sylius:It will add &lt;code&gt;declare(strict_types=1);&lt;/code&gt; to your files.&lt;/p&gt;

&lt;p&gt;You can remove this rule easily:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
imports:
  - { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' }

parameters:
  skip:
    # Will need to be remove when the entire codebase will be fully fixed with phpstan and ecs
    # @see https://stackoverflow.com/questions/48723637/what-does-strict-types-do-in-php
    PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer:
      - '*.php'

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Involve your colleagues
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Add Continues integration
&lt;/h3&gt;

&lt;p&gt;Then, you need to make your team aware of what’s wrong in the project and in each of they’re commits.The only condition that’s really herd to enforce is &lt;strong&gt;YOU CAN’T MERGE IF THE PIPELINE FAILS&lt;/strong&gt;.It would be easier if they are impressed by the previous improvements.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;People won’t change their habits without being forced to.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s a subset of a Gitlab CI file. As you can see, some steps allow failures.This is what I wanted to say when I talked about incremental updates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;codequality&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pre-tests&lt;/span&gt;
  &lt;span class="na"&gt;allow_failure&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer code-style&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer static-analysis -- --level max --error-format gitlab &amp;gt; phpstan-report.json&lt;/span&gt;
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;when&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;reports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;codequality&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;phpstan-report.json&lt;/span&gt;
    &lt;span class="na"&gt;expire_in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1 week&lt;/span&gt;

&lt;span class="na"&gt;mess-detector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pre-tests&lt;/span&gt;
  &lt;span class="na"&gt;allow_failure&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
     &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vendor/bin/phpmd src html unusedcode,cleancode,controversial,design --reportfile=phpmd.html --ignore-violations-on-exit&lt;/span&gt;
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;phpmd.html&lt;/span&gt;
    &lt;span class="na"&gt;expire_in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1 week&lt;/span&gt;

&lt;span class="na"&gt;copy-paste-detector&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pre-tests&lt;/span&gt;
  &lt;span class="na"&gt;allow_failure&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
     &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vendor/bin/phpcpd src --fuzzy --log-pmd=phpcpd.xml || &lt;/span&gt;&lt;span class="no"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# there is no flag to ignore violations on exit&lt;/span&gt;
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;phpcpd.xml&lt;/span&gt;
    &lt;span class="na"&gt;expire_in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1 week&lt;/span&gt;

&lt;span class="na"&gt;phploc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;pre-tests&lt;/span&gt;
  &lt;span class="na"&gt;allow_failure&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
     &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vendor/bin/phploc src --log-xml=phploc.xml&lt;/span&gt;
  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;paths&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;phploc.xml&lt;/span&gt;
    &lt;span class="na"&gt;expire_in&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1 week&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Add code review
&lt;/h3&gt;

&lt;p&gt;After a ticket has been made, every change should be read and discussed with at least one fellow developer.This exchange would allow to help each other, validate that the code corresponds to business expectations and that the tests don’t seem to have any flaws.&lt;/p&gt;

&lt;h2&gt;
  
  
  What will be your workflow
&lt;/h2&gt;

&lt;p&gt;From now on, you will have the informations to know what’s wrong.Locally, while working, use the composer scripts we’ve added to make adjustments. PHPStan and a Code Style fixer will be your best friends.Through the CI, you will enforce your new rules.&lt;/p&gt;

&lt;p&gt;In fine, you will remove superfluous line of code, useless classes, add more types, make the codebase easier to work with.Don’t forget to delete unused classes, methods and variables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Commented lines of code are also potential errors
&lt;/h3&gt;

&lt;p&gt;One more thing, you can also remove all of the commented lines of code if you’re using a version control system like Git.&lt;/p&gt;

&lt;p&gt;Create a new branch. From there, remove all the CLOC on all the project.They are useless piece of information. Why? Because it &lt;a href="https://kentcdodds.com/blog/please-dont-commit-commented-out-code"&gt;hides what’s important&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Finally, if you really wanted to rewrite your project, it will be easier from there.All that remains is to choose metrics to evaluate the achievement of the approach.They can take the form of a minimum tests coverage on critical points of an application, for example.&lt;/p&gt;

&lt;p&gt;Even if your project is not bloated with a lot of bugs, if you’re just started your project, start with the right methodology!I didn’t talk about tests in this blog post but they are really the best way to have a good quality product. They areway more important to add to your workflow than static analysis.&lt;/p&gt;

&lt;p&gt;To me, people who are not working with those tools or equivalent and not doing tests on their projects are not professionals, they are hobbyists. 🤜 🖐️ 🎤&lt;/p&gt;

</description>
      <category>php</category>
      <category>codequality</category>
      <category>symfony</category>
      <category>legacy</category>
    </item>
    <item>
      <title>Guide to get a development environment on Windows 10</title>
      <dc:creator>Dylan Ballandras</dc:creator>
      <pubDate>Wed, 27 Nov 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/kayneth/guide-to-get-a-development-environment-on-windows-10-5jj</link>
      <guid>https://dev.to/kayneth/guide-to-get-a-development-environment-on-windows-10-5jj</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;FYI&lt;br&gt;
It's a repost from a blogpost of 2019. It might still be useful for some. I don't really know as I'm working on Pop_OS! now&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While giving the opportunity to work remotely for a client, I was left with a computer working with… Windows 10.Yeay… Ubuntu, you miss me. 😭&lt;/p&gt;

&lt;p&gt;Here comes the story of a little human developer, trying to leverage Docker on Windows and Azure ActiveDirectory as an accountmanager.&lt;/p&gt;

&lt;p&gt;The goal of this post is to create an environment as close as possible to what we are used to on Linux distro.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn to Windows to “understand” Unix commands
&lt;/h2&gt;

&lt;p&gt;First, we need to have a safe and warm CLI environment to work with.How do you create directories without &lt;code&gt;mkdir&lt;/code&gt;, add aliases as &lt;code&gt;ll&lt;/code&gt; for &lt;code&gt;ls -lah&lt;/code&gt;, symbolic links or to install softwares…&lt;/p&gt;

&lt;p&gt;I can recommend you to head to &lt;a href="https://chocolatey.org/install"&gt;Chocolatey&lt;/a&gt;. It is a package manager for Windows.You can find all packages available through the CLI command &lt;code&gt;choco search a-package-name&lt;/code&gt; or thanks to &lt;a href="https://chocolatey.org/packages"&gt;their website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Yes, first step accomplish! No more install from fancy, non working UI. And yes, you can do things like &lt;code&gt;choco install nodejs&lt;/code&gt;. Or even…Wait for it…&lt;/p&gt;

&lt;h2&gt;
  
  
  Install Docker on Windows
&lt;/h2&gt;

&lt;p&gt;Thanks to the previous step, you can install one of the precious tools that can saves you from installing NodeJS, PHP or anything on your host.As before, use your CLI tool, to write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
choco install docker-desktop

docker -v

docker-compose -v

docker run hello-world

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Thanks to those commands, you might have a working Docker setup. You might use it to test PHP or NodeJS projects. I often simply use the following command when I have to preview locally my blog posts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
docker run --rm -it -p 8000:8000 --workdir /data -v path-to-my-project:/data node:10 yarn develop --host=0.0.0.0

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Get a fancy Console Emulator
&lt;/h2&gt;

&lt;p&gt;My go-to terminal for Windows is called &lt;a href="https://cmder.net/"&gt;Cmder&lt;/a&gt;. It comes with a set of Unix commands and Git-for-Windows integrated.That’s because it’s a package containing Clink and ConEmu which could use Cygwin (to get &lt;code&gt;that Linux feeling - on Windows&lt;/code&gt;).Or, since June 2019 you can find a &lt;a href="https://github.com/microsoft/terminal"&gt;newer terminal for Windows&lt;/a&gt; with Cygwin.&lt;/p&gt;

&lt;p&gt;Heads to an already available console/terminal and type:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;choco install microsoft-windows-terminal&lt;/code&gt; or &lt;code&gt;choco install Cmder&lt;/code&gt; depending on the one you chose.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to share your C drive on Windows for Azure AD users
&lt;/h2&gt;

&lt;p&gt;First, try to follow &lt;a href="https://tomssl.com/2018/01/11/sharing-your-c-drive-with-docker-for-windows-when-using-azure-active-directory-azuread-aad/"&gt;this article&lt;/a&gt;.If it doesn’t work, in File explorer go to the folder you’d like to map as a volume, and add the user and give them full control.With this configuration, I was able to get access to files in docker containers.&lt;/p&gt;

&lt;p&gt;One more thing to consider is &lt;a href="https://www.hanselman.com/blog/DockerDesktopForWSL2IntegratesWindows10AndLinuxEvenCloser.aspx"&gt;an update to WSL2 with the newest Preview of Docker for Windows&lt;/a&gt;.I didn’t try it yet but I have bad performances for Docker compared to my Ubuntu or MacOS. But that was expected… 🤷‍♂️&lt;/p&gt;

&lt;h2&gt;
  
  
  Talking about Windows Sub-system for Linux (WSL)
&lt;/h2&gt;

&lt;p&gt;I tried to work with it but it doesn’t feel right. It feels even slower than using Docker directly with CMD or Powershell.I’m looking forward for WSL 2 in early 2020. Hope this will help all of use, forced/enjoying to work with Windows professionally.&lt;/p&gt;

&lt;p&gt;Today, if you need to install Debian or Ubuntu under WSL, follow &lt;a href="https://docs.microsoft.com/fr-fr/windows/wsl/install-win10"&gt;this great guide from Microsoft&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Update from 02/20/2020:&lt;br&gt;&lt;br&gt;
I now use WSL with &lt;a href="https://asdf-vm.com/"&gt;asdf-vm&lt;/a&gt; for dependencies to PHP or NodeJS. It’s ok, smooth to switch between versions and using the Windows Terminal is better for it.I still use docker and docker-compose for tools like RabbitMQ or Redis.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Enhance your productivity on your PHP projects</title>
      <dc:creator>Dylan Ballandras</dc:creator>
      <pubDate>Mon, 28 Oct 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/kayneth/enhance-your-productivity-on-your-php-projects-24jj</link>
      <guid>https://dev.to/kayneth/enhance-your-productivity-on-your-php-projects-24jj</guid>
      <description>&lt;p&gt;For every new projects I have to work on, I always start by adding at least 3 libraries to ease my workflow.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/phpstan/phpstan"&gt;PHPStan&lt;/a&gt; - A static analysis tool&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://psalm.dev/"&gt;Psalm&lt;/a&gt; - An advanced static analysis tool&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/SyliusLabs/CodingStandard"&gt;Easy Coding Standard&lt;/a&gt; - Pack of rules for Simplify/EasyCodingStandard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They have become my best friends with PHPStorm in order to refactor every piece of code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do you need Static Analysis?
&lt;/h2&gt;

&lt;p&gt;At first, if you are not familiar with static analysis tools, let me explain what they are.You write PHP interfaces, classes, methods and so on. All of that code is orcherstrated to make beautifull apps.But you should know that when adding new features, you may create potential bugs. Here is where those tools come in.&lt;/p&gt;

&lt;p&gt;Static Analysis tools are programs that analyse other codebases without actually executing it. You could find a lot of thosetools online. For instance, there’s a &lt;a href="https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis"&gt;Wikipedia page&lt;/a&gt; listing all known projects.&lt;/p&gt;

&lt;p&gt;They will parse all of your code and try to find potential errors thanks to types and &lt;a href="https://en.wikipedia.org/wiki/Abstract_syntax_tree"&gt;AST&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/exakat/php-static-analysis-tools"&gt;Curated list of PHP Static Analysis tools&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you’re not convinced yet, here is another view on PHPStan:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.martinhujer.cz/how-to-configure-phpstan-for-symfony-applications/"&gt;How to configure PHPStan for Symfony applications&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Nowadays I can’t imagine developing modern PHP applications without PHPStan running on max level with lots of checks.It helps to prevent many issues during development and refactoring of the applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why do you need a Code Style library?
&lt;/h2&gt;

&lt;p&gt;EasyCodingStandard describes itself as “Easiest way to start using PHP CS Fixer and PHP_CodeSniffer with 0-knowledge”.Those two sub-packages enables your team to create a set of style rules to follow during the life of the project.&lt;/p&gt;

&lt;p&gt;Even if you’re working alone, you can take advantage of such tool. Think about projects you left aside for a few month.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now, how to automatically use it?
&lt;/h2&gt;

&lt;p&gt;You will only need those two commands to run:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;vendor/bin/phpstan analyse src --level=max&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;vendor/bin/ecs check src --fix&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 1: Make it simple
&lt;/h3&gt;

&lt;p&gt;Write a &lt;code&gt;Makefile&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="nl"&gt;app@tests&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;app@lint-php app@quality-tests&lt;/span&gt;

&lt;span class="nl"&gt;app@lint-php&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    vendor/bin/ecs check src

&lt;span class="nl"&gt;app@lint-git-diff&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    vendor/bin/ecs check &lt;span class="err"&gt;$$&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;git diff &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="nt"&gt;--diff-filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ACMRTUXB HEAD~..HEAD &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="s1"&gt;'*.php'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="nl"&gt;app@lint-php-fix&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    vendor/bin/ecs check src tests &lt;span class="nt"&gt;--fix&lt;/span&gt;

&lt;span class="nl"&gt;app@quality-tests&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;app@php-analysis&lt;/span&gt;

&lt;span class="nl"&gt;app@php-analysis&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    vendor/bin/phpstan analyse src &lt;span class="nt"&gt;--level&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;max
    vendor/bin/psalm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You could also make it works with composer scripts and any other tool you’re familiar with.&lt;/p&gt;

&lt;p&gt;Then use &lt;code&gt;make app@tests&lt;/code&gt; to be able to spot error prone php code you wrote.Or make use of &lt;a href="https://github.com/phpro/grumphp"&gt;GrumPHP&lt;/a&gt; to add pre-commit hooks if you want to enforce rules before each commit.You could also follow the next part about Gitlab-CI.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Every push should be follow by a CI validation
&lt;/h3&gt;

&lt;p&gt;But to be sure to really automate all the things, write a &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; file. It will be your best friend before merging Merge Requests. :D&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;your-super-duper-php-docker-image"&lt;/span&gt; &lt;span class="c1"&gt;# Or any Docker image&lt;/span&gt;
  &lt;span class="na"&gt;entrypoint&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;before_script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer install --prefer-dist --no-progress --no-suggest --no-interaction&lt;/span&gt;

&lt;span class="na"&gt;variables&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;CI_DEBUG_TRACE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;false"&lt;/span&gt;
  &lt;span class="na"&gt;GIT_SSL_NO_VERIFY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;true"&lt;/span&gt;

&lt;span class="na"&gt;tests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;docker'&lt;/span&gt;
  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;composer validate --no-check-publish&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;php bin/console security:check composer.lock --end-point=https://security.symfony.com/check_lock&lt;/span&gt; &lt;span class="c1"&gt;# If you're working on a Symfony project&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vendor/bin/ecs check $(git diff --name-only --diff-filter=ACMRTUXB HEAD~..HEAD -- '*.php')&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;php vendor/bin/phpstan analyse src --level=max&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If your CI Jobs are reds, you should block any merge from performing before a new validation.&lt;/p&gt;

&lt;p&gt;I prefer to check code style only for the git diff for old projects with a lot of code smells. It also make it easier to review your merge requests as you won’t modify unrelated files.&lt;/p&gt;

&lt;p&gt;I don’t enforce Psalm rules yet. I just started to work with it on newer projects. However, it has a greater understanding of PHPDoc, a &lt;a href="https://psalm.dev/docs/annotating_code/supported_annotations/"&gt;specific set of annotation&lt;/a&gt;, &lt;a href="https://psalm.dev/docs/annotating_code/templated_annotations/"&gt;templating&lt;/a&gt;, &lt;a href="https://psalm.dev/docs/annotating_code/adding_assertions/"&gt;assertions&lt;/a&gt; and great &lt;a href="https://psalm.dev/docs/manipulating_code/refactoring/"&gt;php projects refactoring tools&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this toolchain, you’re ready to work fast but with a nice seatbelt!Furthermore, you could add smoke tests with PHPUnit to your API/Website/CLI project to start with baby steps in the Unit Tests world. 💪&lt;/p&gt;

&lt;p&gt;Honestly, I would love to know what are the equivalent most use tools for &lt;code&gt;C#&lt;/code&gt;!&lt;/p&gt;

</description>
      <category>php</category>
      <category>codequality</category>
      <category>gitlabci</category>
      <category>refactoring</category>
    </item>
    <item>
      <title>How to test your Sylius plugins with Selenium?</title>
      <dc:creator>Dylan Ballandras</dc:creator>
      <pubDate>Mon, 05 Aug 2019 00:00:00 +0000</pubDate>
      <link>https://dev.to/kayneth/how-to-test-your-sylius-plugins-with-selenium-38ci</link>
      <guid>https://dev.to/kayneth/how-to-test-your-sylius-plugins-with-selenium-38ci</guid>
      <description>&lt;p&gt;At &lt;a href="https://www.tataragne.com/"&gt;Tataragne Interactive&lt;/a&gt;, we’re often working on Sylius features through plugins. We use Behat with Selenium for scenarii depending on Javascript functionnalities.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Behat is an open source Behavior-Driven Development framework for PHP. BDD is a methodology for developing software through continuous example-based communication between developers and a business, which this application supports. Scenarii are written in a special format called Gherkin.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Through this blog post, you will learn how to configure your Sylius Plugin project to use Selenium. I consider that you are using &lt;a href="https://github.com/Sylius/PluginSkeleton"&gt;the Sylius plugin skeleton&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding Selenium to our docker-compose configuration
&lt;/h2&gt;

&lt;p&gt;First, we need to a chrome-node (or firefox) to work. We will use two containers. One for the Hub and one for the node. The Hub is the machine where all the tests will run but the code be executed on different nodes as stated on &lt;a href="https://www.seleniumhq.org/docs/07_selenium_grid.jsp#how-selenium-grid-works-with-a-hub-and-nodes"&gt;the Selenium documentation&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# docker-compose.yaml&lt;/span&gt;
&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3.7'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;plugin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# Your app configuration. This is not the subject here&lt;/span&gt;

    &lt;span class="na"&gt;hub&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;selenium/hub:3.11.0&lt;/span&gt;
        &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;4444:4444&lt;/span&gt;
        &lt;span class="na"&gt;links&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;plugin&lt;/span&gt;

    &lt;span class="na"&gt;chrome&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;selenium/node-chrome:3.11.0&lt;/span&gt;
        &lt;span class="c1"&gt;#  You can also use this image and open the  container port to one of your host port to be able to use a VNC viewer&lt;/span&gt;
        &lt;span class="c1"&gt;# image: selenium/node-chrome-debug:3.11.0&lt;/span&gt;
        &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;hub&lt;/span&gt;
        &lt;span class="na"&gt;links&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;plugin&lt;/span&gt;
        &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;HUB_HOST=hub&lt;/span&gt;
            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;HUB_PORT=4444&lt;/span&gt;
        &lt;span class="c1"&gt;# ports:&lt;/span&gt;
        &lt;span class="c1"&gt;#     - 5900:5900&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;With this configuration, you will be able to run &lt;code&gt;docker-compose up -d&lt;/code&gt; and use it easily with your &lt;code&gt;behat.yaml&lt;/code&gt; configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  What do you need to change in behat.yml to be able to run Selenium
&lt;/h2&gt;

&lt;p&gt;The changes in your Behat configuration are really simple.&lt;/p&gt;

&lt;p&gt;First, your may change the &lt;code&gt;base_url&lt;/code&gt; of the &lt;code&gt;Behat\MinkExtension&lt;/code&gt; depending on what you set earlier for the app. For me, in could simply be &lt;code&gt;"http://plugin:80/"&lt;/code&gt; to target my container on the (not secure 😅) port 80.&lt;/p&gt;

&lt;p&gt;Secondly, you have to add your Hub host to your chrome session. Simple add a key &lt;code&gt;wd_host&lt;/code&gt; in the &lt;code&gt;selenium2&lt;/code&gt;configuration of your chrome session.&lt;/p&gt;

&lt;p&gt;Thirdly, you can set &lt;code&gt;javascriptEnabled&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in capabilities.&lt;/p&gt;

&lt;p&gt;Follow the example configuration below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Behat\MinkExtension&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;files_path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/"&lt;/span&gt;
    &lt;span class="na"&gt;base_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://plugin:80/"&lt;/span&gt;  &lt;span class="c1"&gt;# Adapt this&lt;/span&gt;
    &lt;span class="na"&gt;default_session&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;symfony&lt;/span&gt;
    &lt;span class="na"&gt;javascript_session&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;chrome&lt;/span&gt;
    &lt;span class="na"&gt;sessions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;symfony&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;symfony&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;~&lt;/span&gt;
        &lt;span class="na"&gt;chrome&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
            &lt;span class="na"&gt;selenium2&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                &lt;span class="na"&gt;browser&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;chrome&lt;/span&gt;
                &lt;span class="na"&gt;wd_host&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://hub:4444/wd/hub&lt;/span&gt; &lt;span class="c1"&gt;# Add this&lt;/span&gt;
                &lt;span class="na"&gt;capabilities&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                    &lt;span class="na"&gt;browserName&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;chrome&lt;/span&gt;
                    &lt;span class="na"&gt;browser&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;chrome&lt;/span&gt;
                    &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;
                    &lt;span class="na"&gt;marionette&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;null&lt;/span&gt; &lt;span class="c1"&gt;# https://github.com/Behat/MinkExtension/pull/311&lt;/span&gt;
                    &lt;span class="na"&gt;javascriptEnabled&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;  &lt;span class="c1"&gt;# Add this&lt;/span&gt;
                    &lt;span class="na"&gt;chrome&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                        &lt;span class="na"&gt;switches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
                            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;start-fullscreen"&lt;/span&gt;
                            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;start-maximized"&lt;/span&gt;
                            &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;no-sandbox"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;🎉🎉🎉 Your configuration is now ready 🎉🎉🎉&lt;/p&gt;

&lt;p&gt;And as stated in &lt;a href="https://github.com/FriendsOfBehat/SymfonyExtension/issues/80"&gt;this issue of SymfonyExtension&lt;/a&gt;, you might encounter a &lt;code&gt;Session "symfony" is not registered.&lt;/code&gt;. You can follow the changes of the &lt;a href="https://github.com/Sylius/RefundPlugin/pull/138/files"&gt;#138 Pull Request in the Refund Plugin&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope this blog post helped you configure your project for admin or shop scenarii within a Sylius plugin.And I wish to be able to talk about running those tests inside a Gitlab CI job in a future article. 💪&lt;/p&gt;

</description>
      <category>php</category>
      <category>sylius</category>
      <category>behat</category>
      <category>selenium</category>
    </item>
  </channel>
</rss>
