mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace Alchemy\Tests\Phrasea\XSendFile;
|
|
|
|
use Alchemy\Phrasea\XSendFile\Mapping;
|
|
|
|
class MappingTest extends \PhraseanetWebTestCaseAbstract
|
|
{
|
|
public function testOneMapping()
|
|
{
|
|
$mapping = new Mapping(array(
|
|
array(
|
|
'directory' => __DIR__ . '/../../../../files/',
|
|
'mount-point' => '/protected/'
|
|
)
|
|
));
|
|
|
|
$this->assertEquals('/protected/=/home/nlegoff/workspace/Phraseanet/tests/files/', (string) $mapping);
|
|
}
|
|
|
|
public function testMultiMapping()
|
|
{
|
|
$mapping = new Mapping(array(
|
|
array(
|
|
'directory' => __DIR__ . '/../../../../files/',
|
|
'mount-point' => '/protected/'
|
|
),
|
|
array(
|
|
'directory' => __DIR__ . '/../../../../',
|
|
'mount-point' => '/uploads/'
|
|
),
|
|
));
|
|
|
|
$this->assertEquals('/protected/=/home/nlegoff/workspace/Phraseanet/tests/files/,/uploads/=/home/nlegoff/workspace/Phraseanet/tests/', (string) $mapping);
|
|
}
|
|
|
|
public function testMultiMappingWithANotExsistingDir()
|
|
{
|
|
$mapping = new Mapping(array(
|
|
array(
|
|
'directory' => __DIR__ . '/../../../../files/',
|
|
'mount-point' => '/protected/'
|
|
),
|
|
array(
|
|
'directory' => __DIR__ . '/../../../../do_not_exists',
|
|
'mount-point' => '/test/'
|
|
),
|
|
));
|
|
|
|
$this->assertEquals('/protected/=/home/nlegoff/workspace/Phraseanet/tests/files/', (string) $mapping);
|
|
}
|
|
|
|
public function testEmptyMapping()
|
|
{
|
|
$mapping = new Mapping(array());
|
|
|
|
$this->assertEquals('', (string) $mapping);
|
|
}
|
|
} |