Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
aacfe728
Commit
aacfe728
authored
Nov 03, 2007
by
meus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed the tests so that DSN sqlite parsing works. It does not use the syntax in the manual.
parent
7d618587
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
8 deletions
+45
-8
ManagerTestCase.php
tests/ManagerTestCase.php
+45
-8
No files found.
tests/ManagerTestCase.php
View file @
aacfe728
...
...
@@ -65,27 +65,64 @@ class Doctrine_Manager_TestCase extends Doctrine_UnitTestCase {
// sqlite://full/unix/path/to/file.db
// It expects only // since it thinks it is parsing a url
// The problem after that is that the dns is not valid when being passed to PDO
$sqlite
=
'sqlite:/
///
full/unix/path/to/file.db'
;
$sqlitewin
=
'sqlite:
///
c:/full/windows/path/to/file.db'
;
$sqlite
=
'sqlite:/full/unix/path/to/file.db'
;
$sqlitewin
=
'sqlite:c:/full/windows/path/to/file.db'
;
$manager
=
Doctrine_Manager
::
getInstance
();
try
{
$manager
->
parseDsn
(
$mysql
);
$res
=
$manager
->
parseDsn
(
$mysql
);
$expectedMysqlDsn
=
array
(
"scheme"
=>
"mysql"
,
"host"
=>
"localhost"
,
"user"
=>
"user"
,
"pass"
=>
"pass"
,
"path"
=>
"/dbname"
,
"dsn"
=>
"mysql:host=localhost;dbname=dbname"
,
"port"
=>
NULL
,
"query"
=>
NULL
,
"fragment"
=>
NULL
,
"database"
=>
"dbname"
);
$this
->
assertEqual
(
$expectedMysqlDsn
,
$res
);
}
catch
(
Exception
$e
)
{
$this
->
fail
();
$this
->
fail
(
$e
->
getMessage
()
);
}
try
{
$manager
->
parseDsn
(
$sqlite
);
$expectedDsn
=
array
(
"scheme"
=>
"sqlite"
,
"host"
=>
null
,
"user"
=>
null
,
"pass"
=>
null
,
"path"
=>
"/full/unix/path/to/file.db"
,
"dsn"
=>
"sqlite:/full/unix/path/to/file.db"
,
"port"
=>
NULL
,
"query"
=>
NULL
,
"fragment"
=>
NULL
,
"database"
=>
"/full/unix/path/to/file.db"
);
$res
=
$manager
->
parseDsn
(
$sqlite
);
$this
->
assertEqual
(
$expectedDsn
,
$res
);
}
catch
(
Exception
$e
)
{
$this
->
fail
();
$this
->
fail
(
$e
->
getMessage
()
);
}
try
{
$manager
->
parseDsn
(
$sqlitewin
);
$expectedDsn
=
array
(
"scheme"
=>
"sqlite"
,
"path"
=>
"c:/full/windows/path/to/file.db"
,
"dsn"
=>
"sqlite:c:/full/windows/path/to/file.db"
,
"host"
=>
null
,
"port"
=>
NULL
,
"user"
=>
null
,
"pass"
=>
null
,
"query"
=>
NULL
,
"fragment"
=>
NULL
,
"database"
=>
"c:/full/windows/path/to/file.db"
);
$res
=
$manager
->
parseDsn
(
$sqlitewin
);
$this
->
assertEqual
(
$expectedDsn
,
$res
);
}
catch
(
Exception
$e
)
{
$this
->
fail
();
$this
->
fail
(
$e
->
getMessage
()
);
}
}
public
function
prepareData
()
{
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment