You searched for phpunit

  1. 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
  2. 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
  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. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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"
  10. 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
  11. 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
  12. 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
  13. Re-introducing FuelPHP

    . Refine: Run tasks such as migrate, and also your own customized tasks. Package: Install, update and remove packages. Console: Test your code in real-time using an interactive shell. Testing: Run PHPUnit tests. Read more about oil here. FuelPHP Packages Fuel has packages which allow
  14. The Forum PHP Report

    of such caliber - we’re used to expecting more from our, well, heroes. Still, the talk was informative when it wanted to be that and I did learn new things - if not about the pattern, then about the man and the process behind PHPUnit. Jordi Bogianno’s talk was a shovel to the face - I went in expecting
  15. Interactive PHP Debugging with PsySH

    pattern. The UML class diagram of such a pattern is as follows: Do not worry if you do not know much about UML or design patterns, understanding them is not required for this article. Also for this project, I created a set of test cases. Those test cases can be run by phpUnit. Again, you do
  16. PhpStorm 8 - New Features

    components in the IDE RequireJS aliases support CucumberJS and Less 1.6 support Live templates are now suggested in code completion Code blocks automatically indent after closing a curly brace Find the rest here or on the original EAP post. PhpUnit 4.0 Support Two weeks later, EAP 136.1255
  17. PhpStorm 8 Released - See What's New and Grab a Free License

    . New Features in PhpStorm 8 Apart from the previously covered support for Drupal 8, multiple cursors, PHPUnit 4, remote interpreters, Markdown in PHPDoc, PSR4 inspections, ability to open remote URLs from the files referencing them and, of course, Behat support, several new improvements were made
  18. 18 Critical Oversights in Web Development

    specifically constructed to work with PHP projects. If you find this too overwhelming, then at least write unit tests for your application using PHPUnit, Behat or PHPSpec. It may seem a lot of work at first, but it’s proven countless times that tests are helping projects in the long run
  19. 8 Must Have PHP Quality Assurance Tools

    and advice about them - however, we’re open to expanding this list with other QA tools you throw our way that get plenty of votes in the comments below or seem interesting and/or useful enough. 1. PHPUnit Mr. Bergmann’s own PHPUnit is, unsurprisingly, present on the list. PHPUnit is the most