Commit fa942701 authored by Cédric Houbart's avatar Cédric Houbart
Browse files

Set default cashregister name and test for Luxembourg data

parent 196b8909
-- France default data
INSERT INTO LOCATIONS (`ID`, `NAME`, `ADDRESS`) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, 'Caisse', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Catégorie standard');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Formules');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('-1', 'Pré-paiement');
......
-- France default data
INSERT INTO LOCATIONS (`ID`, `NAME`, `ADDRESS`) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, 'Caisse', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Catégorie standard');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Formules');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('-1', 'Pré-paiement');
......
-- France default data
INSERT INTO LOCATIONS (`ID`, `NAME`, `ADDRESS`) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, 'Caisse', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Catégorie standard');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Formules');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('-1', 'Pré-paiement');
......
-- United Kingdoms default data
INSERT INTO LOCATIONS (`ID`, `NAME`, `ADDRESS`) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (`ID`, `NAME`, `LOCATION_ID`) VALUES (1, 'Till', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Standard category');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Compositions');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('-1', 'Pre-payment');
......
-- France default data
INSERT INTO LOCATIONS (ID, NAME, ADDRESS) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (ID, NAME, LOCATION_ID) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (ID, NAME, LOCATION_ID) VALUES (1, 'Caisse', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Catégorie standard');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Formules');
......
-- France default data
INSERT INTO LOCATIONS (ID, NAME, ADDRESS) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (ID, NAME, LOCATION_ID) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (ID, NAME, LOCATION_ID) VALUES (1, 'Caisse', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Catégorie standard');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Formules');
......
-- UK default data
INSERT INTO LOCATIONS (ID, NAME, ADDRESS) VALUES ('0', 'Principal', NULL);
INSERT INTO CASHREGISTERS (ID, NAME, LOCATION_ID) VALUES (1, '', '0');
INSERT INTO CASHREGISTERS (ID, NAME, LOCATION_ID) VALUES (1, 'Till', '0');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('000', 'Standard category');
INSERT INTO CATEGORIES(ID, NAME) VALUES ('0', 'Compositions');
......
......@@ -58,6 +58,12 @@ class InstallDbTest extends \PHPUnit_Framework_TestCase {
$row = $stmt->fetch();
$this->assertEquals("Table 10", $row['NAME'],
"Country data failed to be inserted");
$sql = "SELECT * FROM CASHREGISTERS";
$stmt = $pdo->prepare($sql);
$this->assertNotEquals(false, $stmt->execute(), "Query failed");
$row = $stmt->fetch();
$this->assertEquals("Caisse", $row['NAME'],
"Cash register failed to be inserted");
}
/** @depends testInstallStruct */
......@@ -73,6 +79,33 @@ class InstallDbTest extends \PHPUnit_Framework_TestCase {
$row = $stmt->fetch();
$this->assertEquals("Table 10", $row['NAME'],
"Country data failed to be inserted");
$sql = "SELECT * FROM CASHREGISTERS";
$stmt = $pdo->prepare($sql);
$this->assertNotEquals(false, $stmt->execute(), "Query failed");
$row = $stmt->fetch();
$this->assertEquals("Caisse", $row['NAME'],
"Cash register failed to be inserted");
}
/** @depends testInstallStruct */
public function testInstallLuxembourg() {
Installer::install("luxembourg");
$pdo = PDOBuilder::getPDO();
$this->assertEquals(PT::DB_LEVEL, Installer::getVersion(),
"Version doesn't match");
// Check data insert
$sql = "SELECT * FROM PLACES WHERE ID = '10'";
$stmt = $pdo->prepare($sql);
$this->assertNotEquals(false, $stmt->execute(), "Query failed");
$row = $stmt->fetch();
$this->assertEquals("Table 10", $row['NAME'],
"Country data failed to be inserted");
$sql = "SELECT * FROM CASHREGISTERS";
$stmt = $pdo->prepare($sql);
$this->assertNotEquals(false, $stmt->execute(), "Query failed");
$row = $stmt->fetch();
$this->assertEquals("Caisse", $row['NAME'],
"Cash register failed to be inserted");
}
/** @depends testInstallStruct */
......@@ -88,7 +121,12 @@ class InstallDbTest extends \PHPUnit_Framework_TestCase {
$row = $stmt->fetch();
$this->assertEquals("Table 10", $row['NAME'],
"Country data failed to be inserted");
$sql = "SELECT * FROM CASHREGISTERS";
$stmt = $pdo->prepare($sql);
$this->assertNotEquals(false, $stmt->execute(), "Query failed");
$row = $stmt->fetch();
$this->assertEquals("Till", $row['NAME'],
"Cash register failed to be inserted");
}
}
?>
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment