Exemple #1
0
 protected function __construct()
 {
     parent::__construct();
     // testdatabase - This should be defined in you hosts file
     $this->setLogPath(realpath("../Log"));
     $this->setConnection(new Atrox_Core_Data_MySql_Connection("localhost", "username", "password", "database"));
     $this->getConnection()->connect();
 }
 public function setUp()
 {
     $this->application = Atrox_Core_Application::getInstance(Mock_Application::getInstance());
     $this->application->getConnection()->connect();
     $this->application->setCache($cache = new Atrox_Core_Caching_Memcached());
     $cache->addServer("localhost");
     $this->application->createBlogTable();
     $this->application->createBlogCommentTable();
 }
Exemple #3
0
 protected function __construct()
 {
     parent::__construct();
     // testdatabase - This should be defined in you hosts file
     $validConnectionString = "host=testdatabase port=5432 dbname=AtroxTest user=WebUser password=test";
     $this->setLogPath(realpath("../Log"));
     $this->setConnection(new Atrox_Core_Data_PostgreSql_Connection($validConnectionString));
     $this->getConnection()->connect();
 }
Exemple #4
0
 public function setUp()
 {
     // testdatabase - This should be defined in you hosts file
     $this->validConnectionString = "host=testdatabase port=5432 dbname=AtroxTest user=WebUser password=test";
     $this->application = Atrox_Core_Application::getInstance(Mock_Application::getInstance());
     $this->application->setConnection(new Atrox_Core_Data_PostgreSql_Connection($this->validConnectionString));
     $this->application->getConnection()->connect();
     $this->application->setLogPath(realpath("../../../../../Log"));
     $this->application->createBlogTable();
 }
Exemple #5
0
 public function testValidate()
 {
     $dataSource = Mock_MySql_Blog::getDataSource();
     $entity = $dataSource->makeNew();
     $dataSource->validate($entity);
     $this->assertEquals(array("'Description' is required"), $this->application->getErrorHandler()->getErrors());
     $entity = $dataSource->makeNew();
     $entity->set("Title", "");
     $entity->set("Description", "");
     $dataSource->validate($entity);
     $this->assertEquals(array("'Title' is required", "'Description' is required"), $this->application->getErrorHandler()->getErrors());
 }
Exemple #6
0
    public function setUp()
    {
        $this->application = Atrox_Core_Application::getInstance(Mock_Application::getInstance());
        $this->application->getConnection()->connect();
        $this->application->createBlogTable();
        $sql = <<<SQL
\t\t\tINSERT INTO "TempBlog" ("Title", "Description", "DateCreated") VALUES ('First Blog Entry', 'I love blogging', '2008-05-22 17:15:33.460379');
SQL;
        $this->application->getConnection()->query($sql);
        $sql = <<<SQL
\t\t\tINSERT INTO "TempBlog" ("Title", "Description", "DateCreated") VALUES ('I am a bog', 'A test blog for the featured member section.', '2008-05-28 17:51:24.943435');
SQL;
        $this->application->getConnection()->query($sql);
        $sql = <<<SQL
\t\t\tINSERT INTO "TempBlog" ("Title", "Description", "DateCreated") VALUES ('A new blog entry', 'This is a blog description', '2008-06-20 12:44:56.752169');
SQL;
        $this->application->getConnection()->query($sql);
    }
Exemple #7
0
 public function tearDown()
 {
     $this->application->dropBlogTable();
     $this->application->dropBlogCommentTable();
 }
Exemple #8
0
 public function setUp()
 {
     $this->application = Atrox_Core_Application::getInstance(Mock_Application::getInstance());
     $this->application->getConnection()->connect();
     $this->application->createBlogTable();
 }
Exemple #9
0
 public function testDataConnection()
 {
     $application = Atrox_Core_Application::getInstance();
 }
 public function tearDown()
 {
     $this->application->getConnection()->query("DROP TABLE \"TestMember\";");
     $this->application->getConnection()->close();
 }
Exemple #11
0
 public function setUp()
 {
     $this->acceptHeaders = array("All" => "*/*", "Windows Vista/Safari 3.2.1" => "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Windows Vista/Opera 2.0.172.33" => "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", "Windows Vista/IE 8.0.6001.18783" => "image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*", "Windows Vista/IE Tester - IE 6" => "image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*", "Windows Vista/IE Tester - IE 7" => "image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*", "Windows Vista/Firefox 3.5" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Pure XML" => "text/xml2");
     $application = Atrox_Core_Application::getInstance();
     $this->router = new Atrox_Core_Routing_Http($application);
 }