Exemplo n.º 1
0
 protected function tearDown()
 {
     $database_search = Database_Search::getInstance();
     $database_search->create();
     $database_bibles = Database_Bibles::getInstance();
     $database_bibles->deleteBible("phpunit");
 }
Exemplo n.º 2
0
 public static function getInstance()
 {
     if (empty(self::$instance)) {
         self::$instance = new Database_Search();
     }
     return self::$instance;
 }
Exemplo n.º 3
0
 public function tearDown()
 {
     $database_search = Database_Search::getInstance();
     $database_search->create();
     $database_bibles = Database_Bibles::getInstance();
     $database_bibles->deleteBible("phpunit");
     $database_bibles->deleteBible("phpunit2");
     $database_bibleactions = Database_BibleActions::getInstance();
     $database_bibleactions->clear();
 }
Exemplo n.º 4
0
 public function tearDown()
 {
     $database_search = Database_Search::getInstance();
     $database_search->create();
     $database_bibles = Database_Bibles::getInstance();
     $database_modifications = Database_Modifications::getInstance();
     $database_bibles->deleteBible("phpunit");
     $database_bibles->deleteBible("phpunit2");
     $database_modifications->truncateTeams();
 }
Exemplo n.º 5
0
 public function setUp()
 {
     $this->tearDown();
     $database_search = Database_Search::getInstance();
     $database_search->create();
     $database_bibles = Database_Bibles::getInstance();
     $database_bibles->storeChapter("phpunit1", 1, 2, "data1");
     $database_bibles->storeChapter("phpunit1", 1, 3, "data2");
     $database_bibles->storeChapter("phpunit1", 1, 4, "data3");
     $database_bibles->storeChapter("phpunit2", 2, 5, "data4");
 }
Exemplo n.º 6
0
 public function tearDown()
 {
     $database_search = Database_Search::getInstance();
     $database_search->create();
     $database_bibles = Database_Bibles::getInstance();
     $database_check = Database_Check::getInstance();
     $database_bibles->deleteBible("phpunit");
     $database_check->truncateOutput("");
     $database_check->release(0);
     $database_check->release(1);
     $database_check->release(2);
 }
Exemplo n.º 7
0
 public function testGetVerseCount()
 {
     $database_search = Database_Search::getInstance();
     $database_search->updateSearchFields("phpunit", 2, 3);
     $count = $database_search->getVerseCount("phpunit");
     $this->assertEquals(11, $count);
 }
Exemplo n.º 8
0
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require_once "../bootstrap/bootstrap.php";
page_access_level(Filter_Roles::CONSULTANT_LEVEL);
$database_config_user = Database_Config_User::getInstance();
$database_config_bible = Database_Config_Bible::getInstance();
$database_search = Database_Search::getInstance();
$database_kjv = Database_Kjv::getInstance();
$ipc_focus = Ipc_Focus::getInstance();
$myIdentifier = Filter_User::myIdentifier();
@($bible = $_GET['b']);
if (!isset($bible)) {
    $bible = $database_config_user->getBible();
}
@($load = $_GET['load']);
if (isset($load)) {
    $book = $ipc_focus->getBook();
    $chapter = $ipc_focus->getChapter();
    $verse = $ipc_focus->getVerse();
    // Get Strong's numbers, plus English snippets.
    $searchtext = "";
    $details = $database_kjv->getVerse($book, $chapter, $verse);
Exemplo n.º 9
0
    protected function setUp()
    {
        $this->bible = "PHPUnit";
        $this->repository = uniqid(sys_get_temp_dir() . "/");
        $this->newrepository = uniqid(sys_get_temp_dir() . "/");
        $this->tearDown();
        $database_search = Database_Search::getInstance();
        $database_search->create();
        $database_bibles = Database_Bibles::getInstance();
        $database_bibles->createBible($this->bible);
        mkdir($this->repository);
        mkdir($this->newrepository);
        $command = "cd " . $this->repository . "; git init 2>&1";
        exec($command, $result, $exit_code);
        $command = "cd " . $this->newrepository . "; git init 2>&1";
        exec($command, $result, $exit_code);
        $this->psalms_0_data = <<<EOD
\\id PSA
\\h Izihlabelelo
\\toc2 Izihlabelelo
\\mt2 UGWALO
\\mt LWEZIHLABELELO
EOD;
        $this->psalms_11_data = <<<EOD
\\c 11
\\s IN\\sc KOSI\\sc* iyisiphephelo sabaqotho
\\d Kumqondisi wokuhlabelela. EsikaDavida
\\p
\\v 1 Ngithembela eN\\sc KOSI\\sc*ni\\x + Hlab. 25.2.\\x*. Lingatsho njani emphefumulweni wami: Balekela entabeni yenu \\add njeng\\add*enyoni\\x + 1 Sam. 23.14,19. 26.19,20.\\x*.
\\v 2 Ngoba, khangela, ababi bayagobisa idandili\\x + Hlab. 7.12. Hlab. 64.4.\\x*, balungisa umtshoko wabo entanjeni\\x + Hlab. 7.12. 21.12.\\x*, ukuze batshoke emnyameni abaqotho ngenhliziyo\\x + Hlab. 7.10.\\x*.
\\v 3 Nxa izisekelo zidilizwa\\x + Isa. 19.10. Hlab. 82.5. Hlab. 75.3.\\x*, angenzani olungileyo\\x + Jobe 22.13.\\x*?
\\p
\\v 4 IN\\sc KOSI\\x + Hab. 2.20.\\x*\\sc* isethempelini layo elingcwele\\x + Hlab. 5.7. Hlab. 150.1.\\x*; iN\\sc KOSI\\sc*, isihlalo sayo sobukhosi sisemazulwini\\x + Hlab. 2.4. 103.19. 115.3. 123.1. Isa. 66.1. Mat. 5.34. 23.22. Seb. 7.49. Isam. 4.2.\\x*; amehlo ayo ayakhangela\\x + Jobe 24.23. Hlab. 33.13. 34.15. 66.7. Hlab. 14.2. 102.19. 113.5,6.\\x*, inkophe zayo ziyahlola, abantwana babantu.
\\v 5 IN\\sc KOSI\\sc* iyamhlola olungileyo, kodwa omubi lothanda ubudlwangudlwangu, umphefumulo wayo uyamzonda\\x + Gen. 22.1.\\x*.
\\v 6 Uzanisa phezu kwababi imijibila, umlilo, lesolufa*\\x + Jobe 18.15.\\x*, lomoya otshisayo\\x + Hlab. 119.53. Lilo 5.10.\\x*, kuzakuba yisabelo senkezo yabo\\x + Hlab. 75.8. Jobe 21.20. Hlab. 16.5.\\x*.
\\v 7 Ngoba ilungile iN\\sc KOSI\\sc*, iyathanda ukulunga\\x + Hlab. 33.5. 45.7. Hlab. 37.28. 146.8.\\x*; ubuso bayo buyabona oqotho\\x + Hlab. 33.18. Hlab. 17.2.\\x*.
EOD;
        $this->song_of_solomon_2_data = <<<EOD
\\c 2
\\p
\\v 1 Ngilirozi\\x + Isa. 35.1.\\x* leSharoni\\x + Josh. 12.18.\\x*, umduze wezigodi\\x + 2.16. 4.5. 5.13. 6.2,3. 7.2. 2 Lan. 4.5. Hos. 14.5. Hlab. 45.\\x*.
\\p
\\v 2 Njengomduze phakathi kwameva\\x + 2.16. 4.5. 5.13. 6.2,3. 7.2. 2 Lan. 4.5. Hos. 14.5. Hlab. 45.\\x*, unjalo umngane wami phakathi kwamadodakazi\\x + 1.15.\\x*.
\\p
\\v 3 Njengesihlahla sama-aphula phakathi kwezihlahla zeganga, sinjalo isithandwa sami phakathi kwamadodana\\x + Zaga 25.11.\\x*. Ngahlala emthunzini waso ngathokoza kakhulu\\x + Isa. 25.4. 32.2.\\x*, lesithelo saso simnandi ekunambitheni kwami\\x + Isam. 22.2.\\x*.
\\v 4 Sangisa endlini yewayini, lesiboniso saso phezu kwami siluthando\\x + 1.4.\\x*.
\\v 5 Ngisekelani\\x + Gen. 27.37.\\x* ngeziphiso zewayini\\x + 2 Sam. 6.19. 1 Lan. 16.3. Hos. 3.1.\\x*, lingiqinise ngama-aphula\\x + Zaga 25.11.\\x*, ngoba ngigul\\add isw\\add*a \\add lu\\add*thando\\x + 5.8.\\x*.
\\v 6 Isandla saso sokhohlo singaphansi kwekhanda lami\\x + 8.3. Dute. 33.27.\\x*, lesokunene saso siyangigona\\x + 8.3. Dute. 33.27.\\x*.
\\v 7 Ngiyalifungisa\\x + 3.5. 8.4. 5.8,9.\\x*, madodakazi eJerusalema\\x + 1.5.\\x*, ngemiziki\\x + 2.9,17.\\x*\\x + Zaga 6.5.\\x* kumbe ngezimpala zeganga\\x + 2.9,17.\\x*\\x + Zaga 5.19.\\x*, ukuze lingaphazamisi lingavusi uthando luze luthande.
\\p
\\v 8 Ilizwi lesithandwa sami! Khangela sona siyeza, siseqa phezu kwezintaba, siqolotsha phezu kwamaqaqa\\x + Isa. 52.7.\\x*.
\\v 9 Isithandwa sami sinjengomziki\\x + 2.7,17. 8.14. 2 Sam. 22.34.\\x* kumbe njengethole lendluzele\\x + 2.7,17. 8.14. 2 Sam. 22.34.\\x*\\x + 4.5. 7.3.\\x*. Khangela simi ngemva komduli wethu, silunguza emawindini, sizibonakalisa\\f + \\fk zibonakalisa: \\fl Heb. \\fq hluma.\\f* eminxibeni yewindi\\x + Isa. 14.16.\\x*.
\\v 10 Isithandwa sami saphendula sathi kimi\\x + Hlu. 18.14.\\x*: Vuka wena\\x + 2.13.\\x*, mngane wami, omuhle wami, a\\add si\\add*hambe wena\\x + 1.15.\\x*.
\\v 11 Ngoba khangela, ubusika sebudlulile, izulu seliphelile, lihambile.
\\v 12 Amaluba ayabonakala emhlabeni, isikhathi sokuhlabelela \\add se\\add*sifikile, lelizwi lejuba liyezwakala elizweni lakithi\\x + Hlab. 74.19. Jer. 8.7.\\x*.
\\v 13 Isihlahla somkhiwa sivuthisa imikhiwa yaso eluhlaza, lamavini \\add ale\\add*mpoko\\x + 2.15. 7.12.\\x* aletha iphunga elimnandi\\x + Tshu. 7.1.\\x*. Vuka wena, mngane wami, omuhle wami wena, \\add si\\add*hambe\\x + 2.10.\\x*.
\\p
\\v 14 Juba lami\\x + 5.2. 6.9. 1.15. Mat. 10.16.\\x*, \\add elis\\add*engoxweni yedwala\\x + Jer. 48.28.\\x*\\x + Jer. 49.16. Obad. 3.\\x*, ekusithekeni kweliwa\\x + Hez. 38.20.\\x*, ngitshengisa ubuso bakho, ngizwise ilizwi lakho\\x + 8.13.\\x*, ngoba ilizwi lakho limnandi, lobuso bakho buyabukeka\\x + 1.5.\\x*.
\\v 15 Sibambeleni amakhanka, amakhanka amancinyane, ona izivini\\x + Hez. 13.4. Luka 13.32.\\x*, ngoba izivini zethu \\add zile\\add*zimpoko\\x + 2.15. 7.12.\\x*.
\\v 16 Isithandwa sami ngesami, lami ngingowaso\\x + 6.3. 7.10.\\x*, eselusa phakathi kwemiduze\\x + 2.1. 4.5. 6.3.\\x*.
\\v 17 Kuze kube semadabukakusa, lamathunzi abaleke\\x + 4.6.\\x*, phenduka, sithandwa sami, ube njengomziki kumbe njengethole lendluzele\\x + 8.14. 2.9.\\x* phezu kwezintaba zeBhetheri\\x + 2 Sam. 2.29.\\x*.
EOD;
        mkdir($this->repository . "/Psalms");
        mkdir($this->repository . "/Psalms/0");
        mkdir($this->repository . "/Psalms/11");
        mkdir($this->repository . "/Song of Solomon");
        mkdir($this->repository . "/Song of Solomon/2");
        file_put_contents($this->repository . "/Psalms/0/data", $this->psalms_0_data);
        file_put_contents($this->repository . "/Psalms/11/data", $this->psalms_11_data);
        file_put_contents($this->repository . "/Song of Solomon/2/data", $this->song_of_solomon_2_data);
        $_SERVER['HTTP_USER_AGENT'] = "PHPUnit";
        $_SERVER['REMOTE_ADDR'] = "127.0.0.1";
        $session_logic = Session_Logic::getInstance();
        $session_logic->setUsername("PHPUnit");
    }
Exemplo n.º 10
0
 public function updateSearchFields($name, $book, $chapter)
 {
     $database_search = Database_Search::getInstance();
     $database_search->updateSearchFields($name, $book, $chapter);
 }