mirror of
https://github.com/silverstripe/silverstripe-textextraction
synced 2024-10-22 11:06:00 +02:00
18 lines
499 B
PHP
18 lines
499 B
PHP
<?php
|
|
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');
|
|
|
|
Config::unnest();
|
|
}
|
|
}
|