當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UnitTester::wantToTest方法代碼示例

本文整理匯總了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)
 } //
開發者ID:jonphipps,項目名稱:Metadata-Registry,代碼行數:26,代碼來源:importTest.php

示例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']);
 }
開發者ID:ifigenija,項目名稱:server,代碼行數:16,代碼來源:BoolTest.php


注:本文中的UnitTester::wantToTest方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。