RSPec is a great ruby test framework (for test driven development), anyone knows something like rspec but, for PHP?
RSpec comes with a very handy option to profile your tests. Just by passing the --profile flag you’ll be able to see how long each test takes to run & fix the really slow ones. You have learned how to write tests using the RSpec testing framework. Now it’s your turn to start writing your own test!
RSpec Formatters. The default RSpec output is in the “progress” format. With this format you see dots (.) representing 1 passing test each, an F for a failed test (expected & actual don’t match), or an E for an error. But there are alternative formatting options you can use. Here’s a list: progress; documentation; json; html
The let! method is non-lazy, so the object will be created before any tests are run. Another version of let is subject. The only difference is that you can only have one subject, and it’s meant to be an instance of the main object you are testing. RSpec already creates a default subject like this: This is called the “implicit subject”.
The change matcher also works like this: The default RSpec output is in the “progress” format. With this format you see dots (.) representing 1 passing test each, an F for a failed test (expected & actual don’t match), or an E for an error.
Behat! Built on top of Symfony 2 components. Syntactically, not as nice as Ruby implementation but still get the benefits of BDD.
I just stumbled upon it myself and haven't used it yet. From a glance, it looks like it's using closures (which it would need to do to work like RSpec/Cucumber) which is a PHP 5.3 addition.
http://behat.org/
PHPSpec is a Behaviour-Driven Development framework for php. I've not used it myself yet, though, so I can't comment on it specifically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With