See how it's done in other tests
On Mar 27, 2014 2:36 PM, "VitSalis" <notifications@github.com> wrote:

> In tests/models/round.php:
>
> > +            $round = $this->buildRoundWithCreatures( [] );
> > +            $this->assertFalse( $round->getWinnerId(), 'If there are no players in the round, getWinnerId must return false' );
> > +        }
> > +        public function testWinnerIdMultipleUsers() {
> > +            $user1 = $this->buildUser( 'vitsalis' );
> > +            $user2 = $this->buildUser( 'dionyziz' );
> > +            $users = [ $user1->id => $user1, $user2->id => $user2 ];
> > +            $round = $this->buildRoundWithCreatures( $users );
> > +            $caught = false;
> > +            try {
> > +                $round->getWinnerId();
> > +            }
> > +            catch ( ModelValidationException $e ) {
> > +                $caught = true;
> > +            }
> > +            $this->assertTrue( $caught, 'A ModelValidationException must be caught if the round is not the final one' );
>
> I don't know how to give the function as a parameter..
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dionyziz/endofcodes/pull/183/files#r11020300>
> .
>