Skip to Content

Tag: testing

  • Posted on

    Using anonymous classes to test PHP traits

    Since the release of PHP 5.4, traits have become a standard part of the language. They’re a great way to introduce reusable methods without having to rely on inheritance. But how can we test its methods if it’s not possible to instantiate a trait?