mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #2500 from aynsix/PHRAS-1832-port-1776-to-master
PHRAS-1832 port 1776 to master - databox create
This commit is contained in:
@@ -4,6 +4,7 @@ namespace Alchemy\Tests\Phrasea\Command\Setup;
|
||||
|
||||
use Alchemy\Phrasea\Command\Setup\Install;
|
||||
use Symfony\Component\Yaml\Yaml;
|
||||
use Alchemy\Phrasea\Core\Configuration\StructureTemplate;
|
||||
|
||||
/**
|
||||
* @group functional
|
||||
@@ -20,7 +21,7 @@ class InstallTest extends \PhraseanetTestCase
|
||||
$password = 'sup4ssw0rd';
|
||||
$serverName = 'http://phrasea.io';
|
||||
$dataPath = '/tmp';
|
||||
$template = 'fr';
|
||||
$template = 'fr-simple';
|
||||
|
||||
$infoDb = Yaml::parse(file_get_contents(__DIR__ . '/../../../../../../resources/hudson/InstallDBs.yml'));
|
||||
|
||||
@@ -81,7 +82,7 @@ class InstallTest extends \PhraseanetTestCase
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
return '';
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -93,7 +94,9 @@ class InstallTest extends \PhraseanetTestCase
|
||||
->method('install')
|
||||
->with($email, $password, $this->isInstanceOf('Doctrine\DBAL\Driver\Connection'), $serverName, $dataPath, $this->isInstanceOf('Doctrine\DBAL\Driver\Connection'), $template, $this->anything());
|
||||
|
||||
$command = new Install('system:check');
|
||||
$structureTemplate = self::$DI['cli']['phraseanet.structure-template'];
|
||||
|
||||
$command = new Install('system:check', $structureTemplate);
|
||||
$command->setHelperSet($helperSet);
|
||||
$command->setContainer(self::$DI['cli']);
|
||||
$this->assertEquals(0, $command->execute($input, $output));
|
||||
|
@@ -75,7 +75,7 @@ class InstallerTest extends \PhraseanetTestCase
|
||||
$dataPath = __DIR__ . '/../../../../../datas/';
|
||||
|
||||
$installer = new Installer($app);
|
||||
$installer->install(uniqid('admin') . '@example.com', 'sdfsdsd', $abConn, 'http://local.phrasea.test.installer/', $dataPath, $dbConn, 'en');
|
||||
$installer->install(uniqid('admin') . '@example.com', 'sdfsdsd', $abConn, 'http://local.phrasea.test.installer/', $dataPath, $dbConn, 'en-simple');
|
||||
|
||||
$this->assertTrue($app['configuration.store']->isSetup());
|
||||
$this->assertTrue($app['phraseanet.configuration-tester']->isUpToDate());
|
||||
|
@@ -52,4 +52,27 @@ class StringHelperTest extends \PhraseanetTestCase
|
||||
["ABC\n\rDEF", "ABC\n\nDEF"],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideStringsForSqlQuote
|
||||
* @covers Alchemy\Phrasea\Utilities\StringHelper::SqlQuote
|
||||
*/
|
||||
public function testSqlQuote($string, $mode, $expected)
|
||||
{
|
||||
$result = StringHelper::SqlQuote($string, $mode);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function provideStringsForSqlQuote()
|
||||
{
|
||||
return [
|
||||
["azerty", StringHelper::SQL_VALUE, "'azerty'"],
|
||||
["aze'rty", StringHelper::SQL_VALUE, "'aze''rty'"],
|
||||
["aze`rty", StringHelper::SQL_VALUE, "'aze`rty'"],
|
||||
["azerty", StringHelper::SQL_IDENTIFIER, "`azerty`"],
|
||||
["aze'rty", StringHelper::SQL_IDENTIFIER, "`aze'rty`"],
|
||||
["aze`rty", StringHelper::SQL_IDENTIFIER, "`aze``rty`"],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user