diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-03 03:11:18 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-04-03 03:11:18 +0400 |
commit | 98bc277a08af76e7f498b37b13dada76be727e8f (patch) | |
tree | ea046a63621a8c4caddaae248ef6d29f61bc5228 /tests | |
parent | 23bf6195a3cd3bdb1c24d76690336914f384da0f (diff) |
started to work on command to set number of available custom variables
Diffstat (limited to 'tests')
-rw-r--r-- | tests/PHPUnit/Integration/Core/DbTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/Core/DbTest.php b/tests/PHPUnit/Integration/Core/DbTest.php new file mode 100644 index 0000000000..3a8c31e7e8 --- /dev/null +++ b/tests/PHPUnit/Integration/Core/DbTest.php @@ -0,0 +1,32 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +use Piwik\Db; +use Piwik\Common; + +/** + * Class Core_DbTest + * + * @group Core + */ +class Core_DbTest extends DatabaseTestCase +{ + + public function test_getColumnNamesFromTable() + { + $this->assertColumnNames('access', array('login', 'idsite', 'access')); + $this->assertColumnNames('option', array('option_name', 'option_value', 'autoload')); + } + + private function assertColumnNames($tableName, $expectedColumnNames) + { + $colmuns = Db::getColumnNamesFromTable(Common::prefixTable($tableName)); + + $this->assertEquals($expectedColumnNames, $colmuns); + } + +}
\ No newline at end of file |