public function testProcessProlog() { $I = $this->tester; $this->tester->wantToTest("processing the prolog and importing the file into the database"); $this->import->setCsvReader($this->import->file); $this->import->processProlog(); $prolog = $this->import->prolog; $this->assertEquals(14, count($prolog['columns']), "There are the correct number of columns"); $this->assertEquals(6, count($prolog['prefix']), "There are the correct number of prefix entries"); $this->assertEquals(10, count($prolog['meta']), "There are the correct number of meta entries"); $this->import->getDataColumnIds(); $this->import->processData(); $results = $this->import->results['success']; verify( "There were 8 rows processed", count($results['rows']) )->equals(12); $this->import->processParents(); $I->seeRecordCountInDatabaseTable("SchemaPropertyElement", 138); $I->seeRecordCountInDatabaseTable("SchemaProperty", 12); //prolog namespace entries are readable //prolog headers are actually in row 1 //prolog headers not in row 1 produce fatal error (logged) //prolog entries can be matched to database (column uri matched to profile id) //prolog entries that can't be matched produce fatal error (logged) } //
/** * Test boolean vnosnega polja. * */ public function testBool() { $this->tester->wantToTest('boolean form field'); $this->form->add(['name' => 'v', 'type' => 'boolcheckbox', 'options' => ['required' => false]]); // preverim, da forma ni valid, čeje vrednosti ni $this->form->setData(['v' => null]); $this->assertTrue($this->form->isValid()); $this->form->setData(['v' => '']); $this->assertTrue($this->form->isValid()); $v = $this->form->getData(); $this->assertNull($v['v']); }