addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [php-49] assertBoolean() Method in PHPUnit?

From: Jason K
Sent on: Tuesday, November 13, 2012 2:24 PM
This should work:

$this->assertEquals('boolean', gettype($foo));

On Tue, Nov 13, 2012 at 2:22 PM, Jd Daniel <[address removed]> wrote:
Won't this fail though

$foo = false;
$this-assertTrue($foo === true);



On Tue, Nov 13, 2012 at 2:14 PM, Shivaas Gulati <[address removed]> wrote:
You could try something like 

$this->assertTrue( ($foo === TRUE));
$this->assertFalse( ($foo === FALSE));


- Shivaas

Shivaas Gulati
--------------------------------------------------
co-founding Engineer, Remitly
http://about.me/shivaas



On Tue, Nov 13, 2012 at 2:12 PM, Jd Daniel <[address removed]> wrote:

Hey guys I'm writing a simple test right now to assert that my return value is either a boolean true/false, I figured it out a few months ago but forgot =(

I know if I write

$this->assertTrue($foo);
$this->assertFalse($foo);

I'll always end up failing, any ideas on how to write this test?

Cheers
--
Jd Daniel
Sr. Zend Developer
7901 Delridge Way SW #36D, Seattle

C.    [masked]






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jd Daniel ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Jd Daniel, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Shivaas Gulati ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Shivaas Gulati, visit his/her member profile



--
Jd Daniel
Sr. Zend Developer
7901 Delridge Way SW #36D, Seattle

C.    [masked]






--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jd Daniel ([address removed]) from The Seattle PHP Meetup Group.
To learn more about Jd Daniel, visit his/her member profile
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

Our Sponsors

  • PluralSight

    PluralSight subscriptions for developer training

  • O'Reilly

    Disc Code: PCBW is good for 40% off print and 50% off ebooks and videos

  • JetBrains PhpStorm

    Occasional free licenses to raffle off at meetups

  • DynaTrace

    Find yourself, promote yourself, stay true to yourself.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy