PHPnews.io

Overview for 'testing'

Tests and types

Written by Bram.us / Original link on Jun. 13, 2019

Brent has some thoughts on strong and weakly typed programming languages. Starting point: a simple function that needs testing: rgbToHex(red, green, blue) { // … } Testing the result the function sho…



Check PHP syntax from the command line

Written by code-diesel / Original link on Mar. 4, 2019

PHP command-line interface (CLI) includes a nifty option to quickly check for any syntax errors in a source code file. A simple check for a single file is given below. The option flag to check is -l (lowercase ‘L’). $ php -l example.php If the file contains no syntax errors, the CLI returns the fol…


Testing Symfony applications with PhpStorm

Written by Nehalist.io / Original link on Feb. 10, 2019

I've always been a heavy IDE user - but for some things, like running tests, I still prefered a terminal. Recently I've played around with the in-IDE possibilities for testing and was pretty satisfied with them. Since Symfony ships with a kinda custom testing experience here's how to setup your IDE…


Running for Coverage

Written by Krakjoe / Original link on Jan. 28, 2019

Today we're going to look at the history and the future of coverage collection in PHP.History is the easy bit: For most of the history of PHP, Xdebug has provided the only implementation to php-code-coverage. Simple.Then in 2015, just after phpdbg was merged into PHP, some clever sausages extended…


Faking It

Written by Krakjoe / Original link on Jan. 27, 2019

Fig 1. A MockingbirdAs well as mentoring and code review one of my main tasks at work is to improve the test suites and improve the testing and development methodologies we use. This is no small task and has resulted in the publication of a few extensions, one of them is uopz.Before we continue; I…