Unable to use Adobe Commerce DocBlock annotations in PHPUnit Testing - phpunit

Iā€™m running a local Docker instance of Adobe Commerce (Magento 2) with the following versions:
Magento Enterprise version 2.4.3-p3
phpunit/phpunit version 9.5.28
doctrine/annotations version 2.0.0
allure-framework/allure-php-api version 1.4.0
I have set up PhpStorm to run PHPUnit tests as per the instructions detailed here:
https://developer.adobe.com/commerce/testing/guide/unit/phpstorm/
I'm unable to use the Configuration fixture annotation using the procedure detailed at this link: https://developer.adobe.com/commerce/testing/guide/integration/annotations/magento-config-fixture/
When attempting to, I'm getting the following error:
Class Magento\TestFramework\Annotation\ConfigFixture does not exist
Does anyone know what needs to be done to ensure that the TestFramework classes are available during PHPUnit tests? Thank you in advance for your help

Related

How to solve dependency error for yarn global add #vue/cli?

Within a mac environment I am trying to upgrade the Vue CLI v4.5.13 to 5.0.8 using yarn as a packet manager
enter image description here
After fetching the packages the terminal result is:
ted (end-of-life October 22nd 2023). This package's functionality is now found in the `#apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
[2/4] šŸšš Fetching packages...
error create-strapi-app#3.6.5: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.17.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
Reading the documentation at https://classic.yarnpkg.com/en/docs/cli/global does not help.
I expect to update the VUE CLI regardless to project dependencies and I am missing the command that the command
yarn global upgrade #vue/cli
ignores all existent dependencies and simply updates...
yarn add #vue/cli
finished successfully, but that does not help, due the Vue CLI remains to v4.5.13
What does
Fetching packages...
error create-strapi-app#3.6.5: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.17.1"
states?
Node is incompatible to the node module defined in a local strapi project, right?
How should I handle this and why?
Thank you very much, for your kind explanations...
Trying to update Vue CLI to the latest version and hitting dependency blocks on global layer

Symfony 5 Phpunit undefined method

I'm working with Symfony 5 and I installed phpunit-bridge with the command included in the documentation : composer require --dev symfony/phpunit-bridge.
When I run phpunit with this command, php bin/phpunit, I have this error :
PHP Fatal error : Uncaught Error: Call to undefined method
PHPUnit\TextUI\TestRunner::doRun()
I'll try to guess.
You also have a bundle like liip/functional-test-bundle or other, which require PHPUnit in requirements (or even you require PHPUnit directly in your composer.json together with phpunit-bridge).
As a result you have two different version of PHPUnit installed in project, with two different api.
If installed liip/functional-test-bundle is your case and you do not want to remove it, you need to install by bridge same PHPUnit version as installed by Liip bundle dependency. You can set version through SYMFONY_PHPUNIT_VERSION env variable or directly in bin/phpunit file. Or you can redefine path to already installed PHPUnit version (in vendors/) through SYMFONY_PHPUNIT_DIR env or directly in bin/phpunit.
Note: you can not set SYMFONY_PHPUNIT_VERSION or SYMFONY_PHPUNIT_DIR through .env.* files, since bin/phpunit not read this files. So it should be real env vars.
I had a similar issue with symfony 5.1. I tried upgrading all dev packages related to testing but it didn't work.
Once I completely remove all dev (testing related) packages and reinstalling the symfony phpunit bridge package it worked.
You have to remove the phpunit file inside the root/bin directory
Steps to follow
Remove all dev test packages (Eg: composer remove symfony/browser-kit)
Remove if there are following packages : phpunit/phpunit, symfony/phpunit-bridge, symfony/css-selector, symfony/browser-kit
Install the brdge package again by running composer require --dev symfony/phpunit-bridge

No executable found matching command "dotnet-add"

I just did a fresh install of Fedora 25 (followed by an install of dotnet core 1.1) to explore the possibilities of doing some dotnet core development in an linux environment. On attempting to add my first package I received the following error:
No executable found matching command "dotnet-add"
I have seen some similar errors in other SO posts, but nothing that seems to be helping this issue. I attached some images below of the error, dotnet version info, system path, and dotnet location.
Thanks ahead of any tips!
You have installed a version of the dotnet SDK ("CLI" / dotnet-dev package) of the preview2 time, which is still project.json based. This version of the CLI does not contain the dotnet add set of verbs. These were publicly released with the 1.0.0 version. (at the time of writing, the current version of the SDK / CLI is 1.0.4).
Depending on which instructions you followed to install the components, make sure to update to new versions of the SDK / CLI (e.g. microsoft's install instructions for Fedora).
Note that the version of the SDK / CLI is a different one that the version of the runtime(s) on the machine.
Had the same trouble running VS 2017 Version 15.3.5 found a very helpful article
http://thedatafarm.com/data-access/no-executable-found-matching-command-dotnet-ef/
My Basic problem is the tooling is split into two:
One for CLI: Microsoft.EntityFrameworkCore.Tools.DotNet
One for Powershell: Microsoft.EntityFrameworkCore.Tools

How do I add an apt repository in prudentia

I'm trying to use prudentia to install postgresql. On the latest version of the develop branch, there is a task for posgresql, but that installs the wrong version for me.
I have found here that I need a special apt repository to get the latest (9.3) version. But I need some help installing it from prudentia.
I did see some example in code, but I couldn't find anything about adding repositories in the docs. How should I solve this?
To add an apt repository there are two ways.
1) The simplest one is to use the Ansible apt_repository module that requires the python-apt package installed on the target machine. This module accepts both deb and ppa repositories style.
A Prudentia task for installing PostgreSQL has been provided using this method and can be found here.
2) The second is to provide an apt source file. This approach doesn't have any dependency. The Prudentia Chrome bundled task uses this approach.

Deployment Symfony 2.4 on Microsoft Azure (git/composer)

For the last two days I'm trying to push my application on Azure but I'm facing problems about the Symfony 2.4 deps (with composer). The main error is :
symfony/icu v1.2.1 requires lib-icu >=4.4 -> the requested linked library icu has the wrong version installed or is missing from your system, make sure to have the extension providing it.
I saw on the internet that the problem could be about the php_intl extension not loaded. So after hours I managed to get it by creating a bin\ext\php_intl.dll in my root directory (the documentation does not mention the ext subdirectory, and it was not working for me when I put the intl into the bin directory).
Internationalization support enabled
version 1.1.0
ICU version 49.1.2
ICU Data version 49.1.2
But I always get the same error. Do you have any idea about this?
Thanks.
Try to add in your composer.json :
require: {
"symfony/icu": "1.1.*"
}
See http://symfony.com/doc/current/components/intl.html, chapter "ICU and Deployment Problems"

Resources