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. 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
  5. 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
  6. 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
  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. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. Automated Testing of Drupal 8 Modules

    have different data and core functionality depending on the test itself. What kinds of tests are there in Drupal 8? There are two main types of tests that we can write for Drupal 8: unit tests using PHPUnit (which is in core now) and functional tests (using Simpletest). However
  15. Inspecting PHP Code Quality with Scrutinizer

    for quality assurance. Scrutinizer does, but it doesn’t run tests on public projects, and to power private ones, you need a paid plan. Scrutinizer, therefore, cannot run PHPUnit for you, nor can it provide build status or code coverage. We can, however, configure Travis to send coverage reports
  16. Testing APIs with RAML

    the API, PHPUnit as a testing framework and this PHP-based RAML parser. So, create a composer.json to define these dependencies: { "name": "sitepoint/raml-testing", "description": "A simple example of testing APIs against RAML definitions"
  17. Analyzing a PHP Project with Jenkins

    in which you can find this information. Below, you will see a screenshot of the plot which indicates the total lines of code and comments and the total amount of methods, classes, traits and functions. PHPUnit A big amount of statistics within Jenkins is generated by PHPUnit
  18. Preparing and Building a PHP Project in Jenkins

    to overcome some hurdles. We will be using a fork of Jumph as our basis. First and foremost, we have to make sure that we have tools like PHPUnit and PHP-CodeSniffer available. We can do this in two different ways. Either we install the packages on our Jenkins server through Pear or Composer globally
  19. Installing and Securing Jenkins

    . Introduction to Jenkins The list of things that Jenkins has to offer is huge due to the rich plugin system it has. Basically, Jenkins is just a tool which connects all kinds of different tools and plugins together to create a report for you. For example, it can run PHPUnit and show you the results