Completed
Push — master ( 356279...28992d )
by Dmitry
02:58
created

StorageTest::testRegistration()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Test;
4
5
use Basis\Test;
6
use Basis\Test\Storage as TestStorage;
7
use Basis\Storage;
8
9
class StorageTest extends Test
10
{
11
    public function testUsage()
12
    {
13
        $filename = 'greet.txt';
14
        $contents = 'Hello all!';
15
        $hash = $this->upload($filename, $contents);
16
        $this->assertSame($this->download($hash), $contents);
17
        $this->assertSame($this->get(Storage::class)->url($hash), "/tmp/$hash");
18
    }
19
20
    public function testRegistration()
21
    {
22
        $this->assertInstanceOf(Storage::class, $this->get(Storage::class));
23
        $this->assertInstanceOf(TestStorage::class, $this->get(Storage::class));
24
        $this->assertInstanceOf(Storage::class, $this->get(TestStorage::class));
25
    }
26
}