function MenuDataIntegrityTestCase::testNullMenuWeight
Tests for null/casting weight parameter.
File
-
modules/
simpletest/ tests/ menu.test, line 1763
Class
- MenuDataIntegrityTestCase
- Tests value integrity.
Code
public function testNullMenuWeight() {
$base_options = array(
'link_title' => 'Menu link test',
'module' => 'menu_test',
'menu_name' => 'menu_test',
'weight' => NULL,
'link_path' => 'menu-test/parent',
);
try {
menu_link_save($base_options);
} catch (PDOException $exception) {
$this->fail('Menu weight is not being cast properly.');
return;
}
$this->pass('Menu weight is being cast properly.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.