Example #1
0
 public function testPattern3()
 {
     $verses = array(2 => "He said.", 3 => "He didn't say", 4 => "He said.");
     Checks_Verses::patterns(1, 1, 1, $verses, array("said"));
     $database_check = Database_Check::getInstance();
     $result = $database_check->getHits();
     $standard = array(array('rowid' => "1", 'bible' => "0", 'book' => "1", 'chapter' => "1", 'verse' => "2", 'data' => "Pattern found in text: said"), array('rowid' => "2", 'bible' => "0", 'book' => "1", 'chapter' => "1", 'verse' => "4", 'data' => "Pattern found in text: said"));
     $this->assertEquals($standard, $result);
 }
Example #2
0
        if ($check_well_formed_usfm) {
            $checks_usfm->initialize();
            $checks_usfm->check($chapterUsfm);
            $checks_usfm->finalize();
            $results = $checks_usfm->getResults();
            foreach ($results as $result) {
                $verse = array_keys($result);
                $verse = $verse[0];
                $database_check->recordOutput($bible, $book, $chapter, $verse, $result[$verse]);
            }
        }
        if ($check_missing_punctuation_end_verse) {
            Checks_Verses::missingPunctuationAtEnd($bible, $book, $chapter, $verses_text, $center_marks, $end_marks);
        }
        if ($check_patterns) {
            Checks_Verses::patterns($bible, $book, $chapter, $verses_text, $checking_patterns);
        }
    }
}
// Identifier for this $bible.
$bibleID = $database_bibles->getID($bible);
// Create an email with the checking results for this $bible.
$emailBody = array();
$hits = $database_check->getHits();
foreach ($hits as $hit) {
    if ($hit['bible'] == $bibleID) {
        $passage = Filter_Books::passagesDisplayInline(array(array($hit['book'], $hit['chapter'], $hit['verse'])));
        $data = Filter_Html::sanitize($hit['data']);
        $result = "<p>{$passage} {$data}</p>";
        $emailBody[] = $result;
    }