Esempio n. 1
0
 public function testMarkdown()
 {
     $h = new Helper($this->container);
     $this->assertEquals('<p>Test</p>', $h->markdown('Test'));
     $this->assertEquals('<p>Task #123</p>', $h->markdown('Task #123'));
     $this->assertEquals('<p>Task <a href="?controller=a&amp;action=b&amp;c=d&amp;task_id=123" class="" title="" >#123</a></p>', $h->markdown('Task #123', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))));
 }
Esempio n. 2
0
 public function testMarkdown()
 {
     $h = new Helper($this->container);
     $this->assertEquals('<p>Test</p>', $h->markdown('Test'));
     $this->assertEquals('<p>Task #123</p>', $h->markdown('Task #123'));
     $this->assertEquals('<p>Task <a href="?controller=a&amp;action=b&amp;c=d&amp;task_id=123">#123</a></p>', $h->markdown('Task #123', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))));
     $this->assertEquals('<p>Check that: <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454</a></p>', $h->markdown('Check that: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454', array('controller' => 'a', 'action' => 'b', 'params' => array('c' => 'd'))));
 }
Esempio n. 3
0
<?php

// Makes life easier
chdir(__DIR__);
// Require autoload
require_once '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
// Use auto-loading classes...
use Core\Helper;
use Project\Cvbankas\Lt\Classes\Auditor;
use Project\Cvbankas\Lt\Classes\Browser;
// Get settings: All & Project specific
$settingsAll = Helper::getSettingsAll(__DIR__);
$settingsProject = Helper::getSettingsProject(__DIR__, $settingsAll);
// Initiate main objects to deal with the content
$Browser = new Browser(__DIR__, $settingsAll, $settingsProject);
$Auditor = new Auditor(__DIR__, $settingsAll, $settingsProject);
// Let's make one url download possible
//  In case we will want to download one specific url
//  For example: http://step1.veikt.dev/code/php/project/cvbankas/lt/index.php?url=http://www.cvbankas.lt/pardavimu-telefonu-vadybininkas-e-vilniuje-lietuvos-rinka-vilniuje/1-4204758
if (isset($_REQUEST['url'])) {
    $iJobUrl = $_REQUEST['url'];
    // Get job info
    $iJobList = array($iJobUrl => $iJobUrl);
    $iJob = $Browser->getJobsFromTheList($iJobList);
    // Save info to files
    $iSave = $Browser->saveJobsToFiles($iJob);
    // Log the action
    $Auditor->registerListAndJobs($iJobList, $iJob, $iSave);
    // Done.
    $Auditor->doReport();
    echo "\nDONE.";