protected function EntityMetadataIntegrationTestCase::assertException in Entity API 7
1 call to EntityMetadataIntegrationTestCase::assertException()
- EntityMetadataIntegrationTestCase::testNodeProperties in ./
entity.test - Test all properties of a node.
File
- ./
entity.test, line 1509 - Entity CRUD API tests.
Class
- EntityMetadataIntegrationTestCase
- Tests provided entity property info of the core modules.
Code
protected function assertException($wrapper, $name, $text = NULL) {
$this
->assertTrue(isset($wrapper->{$name}), 'Property wrapper ' . check_plain($name) . ' exists.');
$text = isset($text) ? $text : 'Getting the not existing property ' . $name . ' throws exception.';
try {
$wrapper->{$name}
->value();
$this
->fail($text);
} catch (EntityMetadataWrapperException $e) {
$this
->pass($text);
}
}