diff options
author | Christian Schneider | 2011-04-06 13:41:32 +0000 |
---|---|---|
committer | Christian Schneider | 2011-04-06 13:41:32 +0000 |
commit | 231c1b12e198753decfba9e1679a1d1a70f233ce (patch) | |
tree | 166914d33c0860c848d51819a08216770156e005 /tests/it_dbi.t | |
parent | 25bad1101a8708e259ba7e6204b099ce5cc0bb46 (diff) | |
download | itools-231c1b12e198753decfba9e1679a1d1a70f233ce.tar.gz itools-231c1b12e198753decfba9e1679a1d1a70f233ce.tar.bz2 itools-231c1b12e198753decfba9e1679a1d1a70f233ce.zip |
Added support for localized fields with suffix, e.g. copy title_de to title on read
Diffstat (limited to 'tests/it_dbi.t')
-rwxr-xr-x | tests/it_dbi.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/it_dbi.t b/tests/it_dbi.t index 3ee2562..c885930 100755 --- a/tests/it_dbi.t +++ b/tests/it_dbi.t @@ -215,3 +215,32 @@ $count = 0; foreach ($record as $dummy_rec) $count++; is($count, 2, "Iterator reused"); + +# Test field localization feature + +$dbi->query('create temporary table it_dbi_testlocalized ( + ID int not null auto_increment, + foobar_de varchar(42), + foobar_fr varchar(42), + primary key(ID) +);'); + +$record = new it_dbi($db + array('table' => "it_dbi_testlocalized")); +$record->insert(array('foobar_de' => "deutsch", 'foobar_fr' => "franz")); + +T_set_language('de'); +$record->read(1); +is( + array($record->_key, $record->foobar), + array(1, "deutsch"), + "localized field foobar_de" +); + +T_set_language('fr'); +$record->read(1); +is( + array($record->_key, $record->foobar), + array(1, "franz"), + "localized field foobar_fr" +); + |