silverstripe-textextraction/tests/FileTextCacheDatabaseTest.php

18 lines
499 B
PHP
Raw Normal View History

<?php
2015-11-18 05:07:31 +01:00
class FileTextCacheDatabaseTest extends SapphireTest
{
public function testTruncatesByMaxLength()
{
Config::nest();
Config::inst()->update('FileTextCache_Database', 'max_content_length', 5);
$cache = new FileTextCache_Database();
$file = $this->getMock('File', array('write'));
$content = '0123456789';
$cache->save($file, $content);
$this->assertEquals($cache->load($file), '01234');
2015-11-18 05:07:31 +01:00
Config::unnest();
}
}