ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
simple_test.php
Go to the documentation of this file.
1 <?php
2 #require_once '../src/LibRIS.php';
3 $testdir = 'tests';
4 set_include_path(get_include_path() . PATH_SEPARATOR . './src/');
5 spl_autoload_register(function ($klass) {
6  $parts = explode('\\', $klass);
7  if ($parts[0] == 'LibRIS') {
8  print "Called for $klass" . PHP_EOL;
9  include implode(DIRECTORY_SEPARATOR, $parts) . '.php';
10  }
11 });
12 use \LibRIS\RISReader;
13 
14 $ris = new RISReader();
15 $ris->parseFile($testdir . '/derik-test.ris');
16 $ris->printRecords();
17 $records = $ris->getRecords();
18 $rw = new \LibRIS\RISWriter();
19 print $rw->writeRecords($records);
20 // Regression against Banyuls.ris
21 $ris = new RISReader();
22 $ris->parseFile($testdir . '/Banyuls.ris');
23 $ris->printRecords();
24 $records = $ris->getRecords();
25 $rw = new \LibRIS\RISWriter();
26 print $rw->writeRecords($records);