Using Composer for development environment
Using Composer for development environment
Hello Community,
since a while ago I have written several unit tests that require components which cannot be installed via PEAR, namely phpunit-mockfunction and version 1.x of vfsStream, but can easily be installed and kept up-to-date with Composer. As both components greatly help resp. allow to bring huge parts of our codebase under test at all, I assume you have no objections.
To make it easier for others to run the tests using these components, I suggest to commit composer.json and composer.lock to our SourceForge repository; currently I have them on my machine only, ignored by SVN.
What do you think? Any need to vote?
Christoph
since a while ago I have written several unit tests that require components which cannot be installed via PEAR, namely phpunit-mockfunction and version 1.x of vfsStream, but can easily be installed and kept up-to-date with Composer. As both components greatly help resp. allow to bring huge parts of our codebase under test at all, I assume you have no objections.
To make it easier for others to run the tests using these components, I suggest to commit composer.json and composer.lock to our SourceForge repository; currently I have them on my machine only, ignored by SVN.
What do you think? Any need to vote?
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: Using Composer for development environment
Hm, just learned that PHPUnit drops support for PEAR installation: http://pear.phpunit.de/.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Using Composer for development environment
Hm, no feedback so far. I've put it on the 1.6.3 roadmap for voting.cmb wrote:What do you think? Any need to vote?
Christoph M. Becker – Plugins for CMSimple_XH
Re: Using Composer for development environment
because it's higher esoterics.cmb wrote:Hm, no feedback so far.
Re: Using Composer for development environment
Is there a quick how-to use these test sequences?cmb wrote:To make it easier for others to run the tests using these components, ...
Re: Using Composer for development environment
No, unfortunately not, because the "details" of setting up the tools depend on the system, and Windows could be rather messy in this regard.manu wrote:Is there a quick how-to use these test sequences?
However, it's quite simple if you already have Phing, PHPUnit (I'm still using 4.0.x via PEAR, but a newer version should also work), Runkit and Composer installed. Then you have to create the following composer.json in the root folder:
Code: Select all
{
"require-dev": {
"tcz/phpunit-mockfunction": "1.0.0",
"mikey179/vfsStream": "1.2.0"
}
}
Code: Select all
composer install
Code: Select all
phing unit-tests
Christoph M. Becker – Plugins for CMSimple_XH
Re: Using Composer for development environment
+1 IMO no need to vote.cmb wrote:I suggest to commit composer.json and composer.lock to our SourceForge repository...
What do you think? Any need to vote?
Christoph
Re: Using Composer for development environment
Hello Community,
I have added some of the development dependencies to composer.json -- actually, all dependencies that are available via packagist. Furthermore I have updated the existing dependencies. (r1369+r1370) Some of the test assertions have been deprecated a while ago; for now I have silenced these assertions, but we will have to replace them ASAP, or use a PHPUnit extension that serves as drop-in replacement; as the latter might save a lot of work, we should keep an eye on https://github.com/phpunit/phpunit-dom-assertions.
Christoph
I have added some of the development dependencies to composer.json -- actually, all dependencies that are available via packagist. Furthermore I have updated the existing dependencies. (r1369+r1370) Some of the test assertions have been deprecated a while ago; for now I have silenced these assertions, but we will have to replace them ASAP, or use a PHPUnit extension that serves as drop-in replacement; as the latter might save a lot of work, we should keep an eye on https://github.com/phpunit/phpunit-dom-assertions.
I have created an article regarding the setup of a development environment in the Wiki. I presume I have forgotten some important details, so it would be good if others could verify the explanations, and fix or improve them.cmb wrote:No, unfortunately not, because the "details" of setting up the tools depend on the system, and Windows could be rather messy in this regard.manu wrote:Is there a quick how-to use these test sequences?
Christoph
Christoph M. Becker – Plugins for CMSimple_XH
Re: Using Composer for development environment
This issue (assertTag()) is becoming somewhat urgent, because PHPUnit 4 will reach its EOL on August 7, 2016, and unfortunately there doesn't seem to be further development on phpunit-dom-assertions (and I'm not aware of an alternative).cmb wrote:Some of the test assertions have been deprecated a while ago; for now I have silenced these assertions, but we will have to replace them ASAP, or use a PHPUnit extension that serves as drop-in replacement; as the latter might save a lot of work, we should keep an eye on https://github.com/phpunit/phpunit-dom-assertions.
While some of the affected tests are real unit tests, some are not (they're more like acceptance tests). So I tend to replace the latter with real end-to-end tests (Selenium seems to be a suitable platform for that), and to remove the respective PHPUnit tests completely. In the long run it would be great to have full code coverage with unit tests, but for now I don't see any reasonable way to do so.
Anyhow, would anybody be willing to help to write Selenium tests? For a start, SeleniumIDE tests might be sufficient.
Christoph M. Becker – Plugins for CMSimple_XH