Changeset 4044

Show
Ignore:
Timestamp:
03/19/08 06:52:29 (16 months ago)
Author:
jwage
Message:

Added new failing test for parseDsn()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/tests/ManagerTestCase.php

    r3975 r4044  
    6060    { 
    6161        $mysql = 'mysql://user:pass@localhost/dbname'; 
    62          
    63         // This is what is specified in the manul 
    64         // I think it should be this for parse_url() to work 
    65         // sqlite://full/unix/path/to/file.db 
    66         // It expects only // since it thinks it is parsing a url 
    67         // The problem after that is that the dns is not valid when being passed to PDO 
    6862        $sqlite = 'sqlite:////full/unix/path/to/file.db'; 
    6963        $sqlitewin = 'sqlite:///c:/full/windows/path/to/file.db'; 
     64        $sqlitewin2 = 'sqlite:///D:\full\windows\path\to\file.db'; 
    7065         
    7166        $manager = Doctrine_Manager::getInstance(); 
     
    125120            $this->fail($e->getMessage()); 
    126121        } 
     122 
     123        try { 
     124             $expectedDsn = array( 
     125                "scheme" => "sqlite", 
     126                "host" => null, 
     127                "path" => 'D:\full\windows\path\to\file.db', 
     128                "dsn" => 'sqlite:D:\full\windows\path\to\file.db', 
     129                "port" => NULL, 
     130                "user" => null, 
     131                "pass" => null, 
     132                "query" => NULL,  
     133                "fragment" => NULL, 
     134                "database" => 'D:\full\windows\path\to\file.db'); 
     135            $res = $manager->parseDsn($sqlitewin2); 
     136            $this->assertEqual($expectedDsn, $res); 
     137        } catch (Exception $e) { 
     138            $this->fail($e->getMessage()); 
     139        } 
    127140    } 
    128141