PHPSpec2 documentation availalble

178 views
Skip to first unread message

MissYeh

unread,
Mar 14, 2013, 4:38:11 AM3/14/13
to phpsp...@googlegroups.com
Im fairly new to PHPSpec and in the dark of all available matchers.

Examples I found in other people's code but didn't find in the current manual:
  • beConstructedWith
  • shouldNotBeLocked
  • etc


I've googled and googled for it but couldn't find anything other than the manual of the phpspec site and broken links to the old phpspec documentation.

Does anyone have or know where to find full documentation or tell me what I'm not seeing?


Thanks,


Kana

Marco Lopes

unread,
Mar 14, 2013, 6:05:09 AM3/14/13
to phpsp...@googlegroups.com
Hi Kana,

Not sure about beLocked though.

Cheers,
Marco Lopes


--
You received this message because you are subscribed to the Google Groups "PHPSpec - Behavior Driven Design (BDD) for PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpspec-dev...@googlegroups.com.
To post to this group, send email to phpsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/phpspec-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

MissYeh

unread,
Mar 21, 2013, 9:08:58 AM3/21/13
to phpsp...@googlegroups.com
Hey thanks Marco,

What I wonder is, is there an online manual (e.g. like http://www.phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html)  with a complete list of matchers for PHPSpec available that I can't find?

Kana

jlo...@inviqa.com

unread,
Mar 21, 2013, 10:41:11 AM3/21/13
to phpsp...@googlegroups.com
I am working on it and would be in the website this week.

MissYeh

unread,
Mar 21, 2013, 11:33:26 AM3/21/13
to phpsp...@googlegroups.com
Great, looking forward to it!

:)

Jakub Zalas

unread,
Mar 22, 2013, 5:02:54 AM3/22/13
to phpsp...@googlegroups.com
In a meantime you can see a list of available matchers in the source code: https://github.com/phpspec/phpspec2/tree/develop/src/PHPSpec2/Matcher

I know it's not convenient but should let you going ;)

shouldNotBeLocked looks like a custom matcher.

Marco Lopes

unread,
Mar 22, 2013, 6:02:02 AM3/22/13
to phpsp...@googlegroups.com
shouldNotBeLocked might be a ObjectState Matcher. ObjectState Matcher are created automatically by PHPSpec 2 when a class you're specifying has a method named, for example, isLocked that returns a boolean. In this case you can just call shouldBeLocked and shouldNotBeLocked on the specification, and PHPSpec will verify if isLocked (on your class) returns true or false, and pass or fail the assertion accordingly. 

Cheers,
Marco Lopes


--

Jakub Zalas

unread,
Mar 22, 2013, 6:53:34 AM3/22/13
to phpsp...@googlegroups.com
Good spot Marco!



--
You received this message because you are subscribed to a topic in the Google Groups "PHPSpec - Behavior Driven Design (BDD) for PHP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phpspec-dev/py2nhSdAzwA/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to phpspec-dev...@googlegroups.com.

To post to this group, send email to phpsp...@googlegroups.com.
Visit this group at http://groups.google.com/group/phpspec-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
kind regards
Jakub Zalas

skype: jakub.zalas

Twitter Picasa Facebook LinkedIn Amazon Blog RSS Google Reader Last.fm YouTube Google github social coding goodreads

Luis Cordova

unread,
Apr 30, 2013, 8:16:48 PM4/30/13
to phpsp...@googlegroups.com
in addition to this there are methods such as haveMethod, https://github.com/phpspec/phpspec2/blob/develop/spec/PHPSpec2/Matcher/ObjectStateMatcher.php#L67

I haven't seen it in much use but sounds like you have to use that wisely of course and not abuse it
Reply all
Reply to author
Forward
0 new messages