本文整理汇总了PHP中UnitTester::wantToTest方法的典型用法代码示例。如果您正苦于以下问题:PHP UnitTester::wantToTest方法的具体用法?PHP UnitTester::wantToTest怎么用?PHP UnitTester::wantToTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitTester
的用法示例。
在下文中一共展示了UnitTester::wantToTest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testProcessProlog
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)
} //
示例2: testBool
/**
* 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']);
}