Completed
Pull Request — master (#28)
by
unknown
08:00
created

testTruncatesByMaxLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
1
<?php
2
class FileTextCacheDatabaseTest extends SapphireTest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
3
{
4
    public function testTruncatesByMaxLength()
5
    {
6
        Config::nest();
7
        
8
        Config::inst()->update('FileTextCache_Database', 'max_content_length', 5);
9
        $cache = new FileTextCache_Database();
10
        $file = $this->getMock('File', array('write'));
0 ignored issues
show
Bug introduced by
The method getMock() does not seem to exist on object<FileTextCacheDatabaseTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
11
        $content = '0123456789';
12
        $cache->save($file, $content);
13
        $this->assertEquals($cache->load($file), '01234');
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<FileTextCacheDatabaseTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
15
        Config::unnest();
16
    }
17
}
18