You searched for phpunit

  1. Using Selenium with PHPUnit

    to do unit testing using PHPUnit, or that you at least have a grasp of what it’s all about. Let’s get started. What Is Acceptance Testing? Acceptance testing is the process of telling user stories through tests, and I love this quote to describe it: A formal test conducted to determine
  2. Error Condition Testing with PHPUnit

    Let’s say you’re maintaining code that uses PHP’s native trigger_error() function to log error information. Let’s also say that you’re in the process of using PHPUnit to write unit tests for that code. If you refer to the PHPUnit manual, there's a section that deals with testing for error
  3. PHPMaster: Getting Started with PHPUnit

    ? This is where unit testing comes in, to automate the testing process. Unit testing makes it easier, and above all safer, to modify your code because it catches any irregularities in the behavior (i.e More: PHPMaster: Getting Started with PHPUnit
  4. Getting Started with PHPUnit

    of unit testing with PHPUnit and how easy it is to get started using it as I guide you trough the process of writing your first test. Before you can start writing your first unit test, you need to have PHPUnit installed. It can easily be installed using the PEAR installer, and the process
  5. Advanced PHPUnit Testing: Annotations and Mocking

    In the first two parts of this series (Introduction to Unit Testing in PHP with PHPUnit and Getting to Know PHPUnit’s Assertions), I’ve walked you through some of the steps you can take to test your application. I showed you how, with the help of PHPUnit, you can write tests that are as simple
  6. Using the Selenium Web Driver API with PHPUnit

    Previously, we demonstrated using Selenium with PHPUnit and used a user subscription form example throughout the article. In this one, we are going to explore Facebook’s webdriver package for emulating a browser. It is recommended you go through the previous article first, as it covers some
  7. Tutorial: Introduction to Unit Testing in PHP with PHPUnit

    get to the good part—a practical example that you can sink your teeth into. For the sake of my examples, I'm only going to use one of the more popular unit-testing tools out there, PHPUnit. This amazing application was developed by Sebastian Bergmann, and it provides an excellent set of features
  8. Crash Course into Continuous Testing with Sismo

    ('master'); $projects[] = $pxProject; return $projects; By default, Sismo will run the phpunit command, but you can change this using the setCommand method when configuring your project. You may also specify a bash statement, because it will directly be run on the terminal. // tests
  9. Contributing to Open Source: Gatekeeper Case Study

    use our trusty Homestead Improved for this. Once the VM has been set up and SSHed into, we can clone our fork, install dependencies and run tests: git clone https://github.com/swader/gatekeeper cd gatekeeper composer install vendor/bin/phpunit All the tests should be green: At this point
  10. Easy Continuous Delivery with ContinuousPHP and Zend Server

    page, but of course you can also add a new testing framework as well. To do this, simply click the + icon and select the testing framework you wish to add. I’m going to add PHPUnit to my pipeline. All I have to do is enter the path to the testing configuration, in this case defined at: /module
  11. Learn PHP 7, Find out What's New, and More

    --no-interaction --prefer-source script: - phpunit --coverage-text --coverage-clover=coverage.clover after_script: - if ]; then php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover; fi The above was inspired by the PhpLeague skeleton - a PHP 7 ready skeleton
  12. Suggesting Carbon with Composer - Date and Time the Right Way

    this one first defaults to getDate if the estimatedDate could not be determined. Running the tests should now show everything passing: vagrant@homestead:~/Code/diffbot-php-client$ phpunit PHPUnit 5.0.8 by Sebastian Bergmann and contributors. Runtime: PHP 5.6.10-1+deb.sury.org~trusty+1
  13. Breaking Free from Guzzle5 with PHP-HTTP and HTTPlug

    the current stable version of the SDK: git clone https://github.com/swader/diffbot-php-client cd diffbot-php-client git checkout tags/0.4.5 composer install phpunit The last command assumes PHPUnit is globally installed on the development environment. All tests should pass (except for a skipped
  14. BDD in Laravel: Getting Started with Behat and PhpSpec

    a configuration variable is just a config("somevar") away. These bindings are all automatically available and ready to be used. Using PHPUnit’s Assertions Behat doesn’t have assertions per-se. As such, you may want to use PHPUnit’s. Seeing as PHPUnit comes bundled with new Laravel apps, it’s
  15. Building a Custom Twig Filter the TDD Way

    . We’ll build it in a TDD way. To get introduced to TDD, see this post and the links within it, but the approaches we take in this tutorial should be easy enough to understand even without looking into TDD beforehand. First, install PHPUnit by executing the following Composer command: composer
  16. Grumpy Programmer's Testing Bundle: Review

    and The Grumpy Programmer’s PHPUnit Cookbook. It was my hope that those books will prevent me from using the shoddy practices I displayed in that original post and which originally prompted Matthew Weier O’Phinney’s critique. In this post, I’d like to share with you what I’ve learned, and how much this helped
  17. Mastering Composer - Tips and Tricks

    /somepackage:someversion This adds everything that’s needed into the file, bypassing all manual intervention. If you need to add packages to require-dev, add the --dev option, like so: composer require phpunit/phpunit --dev The require command supports adding several
  18. API Client TDD with Mocked Responses

    In parts one and two, we built some very basic functionality and used TDD with PHPUnit to make sure our classes are well tested. We also learned how to test an abstract class in order to make sure its concrete methods worked. Now, let’s continue building our library. Catch up I took
  19. Basic TDD in Your New PHP Package

    or clone the part 1 branch of this tutorial’s code. PHPUnit We’ve covered PHPUnit to some degree before (1, 2, 3, 4, 5, 6), but it’s time we put it into real practice now. First, let’s check if it’s installed. php vendor/phpunit/phpunit/phpunit Running this command should produce