public function grade(CodingExecutionResult $result)
 {
     $result->assertInputContains('new_toy.php', '$_POST');
     $result->assertVariableEquals('name', 'Fluffy Pig Stuffed Animal');
     $result->assertVariableEquals('description', 'Your dog will *love* to chew and destroy this adorable pig!');
     $result->assertInputContains('new_toy.php', 'var_dump');
 }
 public function grade(CodingExecutionResult $result)
 {
     $expected = 'I luv kittens';
     $result->assertOutputContains($expected);
     $result->assertElementContains('h2', $expected);
     $result->assertVariableEquals('airpupTag', $expected);
     $result->assertInputContains('index.php', 'echo');
 }
 public function grade(CodingExecutionResult $result)
 {
     $result->assertVariableEquals('waggyPig', array('name' => 'Waggy Pig', 'weight' => 10, 'age' => 7, 'bio' => 'Sleepy white fluffy dog'));
     $result->assertElementContains('h2', 'Waggy Pig');
     // help them out - I reversed the order on the elements
     if ($result->getElementText('.age') == '10') {
         throw new GradingException('Careful! Be sure to print the `age` key in the `.age` element and the
             `weight` key in the `.weight` element. You might have them reversed.');
     }
     $result->assertElementContains('.age', 7);
     $result->assertElementContains('.weight', 10);
     $result->assertElementContains('p', 'Sleepy white fluffy dog');
 }
 public function grade(CodingExecutionResult $result)
 {
     $result->assertVariableEquals('dogWalkers', array('Kitty', 'Tiger', 'Jay'));
 }
 public function grade(CodingExecutionResult $result)
 {
     $result->assertVariableEquals('waggyPig[breed]', 'bichon');
     $result->assertInputContains('index.php', '$waggyPig[', 'Add the `breed` key *after* the `$waggyPig` variable is created using the `[\'breed\']` syntax');
     $result->assertElementContains('.breed', 'bichon');
 }