本文整理汇总了PHP中Propel\Tests\Bookstore\Author::getLastName方法的典型用法代码示例。如果您正苦于以下问题:PHP Author::getLastName方法的具体用法?PHP Author::getLastName怎么用?PHP Author::getLastName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Propel\Tests\Bookstore\Author
的用法示例。
在下文中一共展示了Author::getLastName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInvalidCharset
public function testInvalidCharset()
{
$this->markTestSkipped('Skipped because of weird behavior on some platforms');
$db = Propel::getServiceContainer()->getAdapter(BookPeer::DATABASE_NAME);
if ($db instanceof SqliteAdapter) {
$this->markTestSkipped();
}
$a = new Author();
$a->setFirstName("Б.");
$a->setLastName("АКУНИН");
$a->save();
$authorNameWindows1251 = iconv("utf-8", "windows-1251", $a->getLastName());
$a->setLastName($authorNameWindows1251);
// Different databases seem to handle invalid data differently (no surprise, I guess...)
if ($db instanceof PgsqlAdapter) {
try {
$a->save();
$this->fail("Expected an exception when saving non-UTF8 data to database.");
} catch (Exception $x) {
print $x;
}
} else {
// No exception is thrown by MySQL ... (others need to be tested still)
$a->save();
$a->reload();
$this->assertEquals("", $a->getLastName(), "Expected last_name to be empty (after inserting invalid charset data)");
}
}