Name = 'Fred Bloggs';
$comment->Comment = 'This is a comment';
$attr = array();
try {
$class = new ReflectionClass($gridfield);
$method = $class->getMethod('newRow');
$method->setAccessible(true);
}
catch (ReflectionException $e) {
$this->fail($e->getMessage());
}
$params = array(1, 1, $comment, $attr, $comment->Comment);
$newRow = $method->invokeArgs($gridfield, $params);
$this->assertEquals('
This is a comment
', $newRow);
$attr = array('class' => 'cssClass');
$params = array(1, 1, $comment, $attr, $comment->Comment);
$newRow = $method->invokeArgs($gridfield, $params);
$this->assertEquals('This is a comment
', $newRow);
$comment->markSpam();
$params = array(1, 1, $comment, $attr, $comment->Comment);
$newRow = $method->invokeArgs($gridfield, $params);
$this->assertEquals('This is a comment
', $newRow);
}
}