0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 00:41:52 +00:00
htmlpurifier/tests/HTMLPurifier/LanguageFactoryTest.php

35 lines
804 B
PHP
Raw Normal View History

<?php
class HTMLPurifier_LanguageFactoryTest extends HTMLPurifier_Harness
{
/**
* Protected reference of global factory we're testing.
*/
protected $factory;
public function setUp()
{
$this->factory = HTMLPurifier_LanguageFactory::instance();
parent::setUp();
}
public function test()
{
$this->config->set('Core.Language', 'en');
$language = $this->factory->create($this->config, $this->context);
$this->assertIsA($language, 'HTMLPurifier_Language');
$this->assertIdentical($language->code, 'en');
// lazy loading test
$this->assertIdentical(count($language->messages), 0);
$language->load();
$this->assertNotEqual(count($language->messages), 0);
}
}
// vim: et sw=4 sts=4