-
Notifications
You must be signed in to change notification settings - Fork 435
Expand file tree
/
Copy pathFsConnectionFactoryTest.php
More file actions
54 lines (42 loc) · 1.54 KB
/
FsConnectionFactoryTest.php
File metadata and controls
54 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Enqueue\Fs\Tests;
use Enqueue\Fs\FsConnectionFactory;
use Enqueue\Fs\FsContext;
use Enqueue\Test\ClassExtensionTrait;
use Enqueue\Test\ReadAttributeTrait;
use Interop\Queue\ConnectionFactory;
class FsConnectionFactoryTest extends \PHPUnit\Framework\TestCase
{
use ClassExtensionTrait;
use ReadAttributeTrait;
public function testShouldImplementConnectionFactoryInterface()
{
$this->assertClassImplements(ConnectionFactory::class, FsConnectionFactory::class);
}
public function testThatItDoesNotCrashOnStringNumericValues()
{
$factory = new FsConnectionFactory([
'path' => __DIR__,
'pre_fetch_count' => '123',
'chmod' => '0765',
]);
$context = $factory->createContext();
$this->assertInstanceOf(FsContext::class, $context);
$this->assertAttributeSame(__DIR__, 'storeDir', $context);
$this->assertAttributeSame(123, 'preFetchCount', $context);
$this->assertAttributeSame(0765, 'chmod', $context);
}
public function testShouldCreateContext()
{
$factory = new FsConnectionFactory([
'path' => __DIR__,
'pre_fetch_count' => 123,
'chmod' => 0765,
]);
$context = $factory->createContext();
$this->assertInstanceOf(FsContext::class, $context);
$this->assertAttributeSame(__DIR__, 'storeDir', $context);
$this->assertAttributeSame(123, 'preFetchCount', $context);
$this->assertAttributeSame(0765, 'chmod', $context);
}
}