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
871e73fe
Commit
871e73fe
authored
Jan 27, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
25f1d5e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
163 additions
and
17 deletions
+163
-17
FirebirdTestCase.php
tests/Export/FirebirdTestCase.php
+43
-6
OracleTestCase.php
tests/Export/OracleTestCase.php
+31
-0
FromTestCase.php
tests/Query/FromTestCase.php
+49
-9
SubqueryTestCase.php
tests/Query/SubqueryTestCase.php
+40
-2
No files found.
tests/Export/FirebirdTestCase.php
View file @
871e73fe
<?php
class
Doctrine_Export_Firebird_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCreateDatabaseDoesNotExecuteSql
()
{
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Export_Firebird_TestCase
*
* @package Doctrine
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Export_Firebird_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCreateDatabaseDoesNotExecuteSql
()
{
try
{
$this
->
export
->
createDatabase
(
'db'
);
$this
->
fail
();
...
...
@@ -8,7 +41,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase {
$this
->
pass
();
}
}
public
function
testDropDatabaseDoesNotExecuteSql
()
{
public
function
testDropDatabaseDoesNotExecuteSql
()
{
try
{
$this
->
export
->
dropDatabase
(
'db'
);
$this
->
fail
();
...
...
@@ -16,7 +50,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase {
$this
->
pass
();
}
}
public
function
testCreateTableSupportsAutoincPks
()
{
public
function
testCreateTableSupportsAutoincPks
()
{
$name
=
'mytable'
;
$fields
=
array
(
'id'
=>
array
(
'type'
=>
'integer'
,
'unsigned'
=>
1
,
'autoincrement'
=>
true
));
...
...
@@ -31,7 +66,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase {
NEW.id = GEN_ID(mytable_seq, 1);
END'
);
}
public
function
testCreateTableSupportsDefaultAttribute
()
{
public
function
testCreateTableSupportsDefaultAttribute
()
{
$name
=
'mytable'
;
$fields
=
array
(
'name'
=>
array
(
'type'
=>
'char'
,
'length'
=>
10
,
'default'
=>
'def'
),
'type'
=>
array
(
'type'
=>
'integer'
,
'length'
=>
3
,
'default'
=>
12
)
...
...
@@ -42,7 +78,8 @@ class Doctrine_Export_Firebird_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$this
->
adapter
->
pop
(),
'CREATE TABLE mytable (name CHAR(10) DEFAULT \'def\', type INT DEFAULT 12, PRIMARY KEY(name, type))'
);
}
public
function
testCreateTableSupportsMultiplePks
()
{
public
function
testCreateTableSupportsMultiplePks
()
{
$name
=
'mytable'
;
$fields
=
array
(
'name'
=>
array
(
'type'
=>
'char'
,
'length'
=>
10
),
'type'
=>
array
(
'type'
=>
'integer'
,
'length'
=>
3
));
...
...
tests/Export/OracleTestCase.php
View file @
871e73fe
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Export_Oracle_TestCase
*
* @package Doctrine
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Export_Oracle_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testCreateSequenceExecutesSql
()
{
$sequenceName
=
'sequence'
;
...
...
tests/Query/FromTestCase.php
View file @
871e73fe
<?php
class
Doctrine_Query_From_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testLeftJoin
()
{
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Export_Oracle_TestCase
*
* @package Doctrine
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Query_From_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testLeftJoin
()
{
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User u LEFT JOIN u.Group'
);
...
...
@@ -10,7 +43,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
8
);
}
public
function
testDefaultJoinIsLeftJoin
()
{
public
function
testDefaultJoinIsLeftJoin
()
{
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User u JOIN u.Group'
);
...
...
@@ -20,7 +54,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
8
);
}
public
function
testInnerJoin
()
{
public
function
testInnerJoin
()
{
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User u INNER JOIN u.Group'
);
...
...
@@ -30,7 +65,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
1
);
}
public
function
testMultipleLeftJoin
()
{
public
function
testMultipleLeftJoin
()
{
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User u LEFT JOIN u.Group LEFT JOIN u.Phonenumber'
);
...
...
@@ -40,7 +76,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
8
);
}
public
function
testMultipleLeftJoin2
()
{
public
function
testMultipleLeftJoin2
()
{
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User u LEFT JOIN u.Group LEFT JOIN u.Phonenumber'
);
...
...
@@ -50,7 +87,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
8
);
}
public
function
testMultipleInnerJoin
()
{
public
function
testMultipleInnerJoin
()
{
$q
=
new
Doctrine_Query
();
$q
->
select
(
'u.name'
)
->
from
(
'User u INNER JOIN u.Group INNER JOIN u.Phonenumber'
);
...
...
@@ -60,7 +98,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
1
);
}
public
function
testMultipleInnerJoin2
()
{
public
function
testMultipleInnerJoin2
()
{
$q
=
new
Doctrine_Query
();
$q
->
select
(
'u.name'
)
->
from
(
'User u INNER JOIN u.Group, u.Phonenumber'
);
...
...
@@ -70,7 +109,8 @@ class Doctrine_Query_From_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
1
);
}
public
function
testMixingOfJoins
()
{
public
function
testMixingOfJoins
()
{
$q
=
new
Doctrine_Query
();
$q
->
select
(
'u.name, g.name, p.phonenumber'
)
->
from
(
'User u INNER JOIN u.Group g LEFT JOIN u.Phonenumber p'
);
...
...
tests/Query/SubqueryTestCase.php
View file @
871e73fe
<?php
class
Doctrine_Query_Subquery_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testSubqueryWithWherePartAndInExpression
()
{
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Query_Subquery_TestCase
* This test case is used for testing DQL subquery functionality
*
* @package Doctrine
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @since 1.0
* @version $Revision$
*/
class
Doctrine_Query_Subquery_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testSubqueryWithWherePartAndInExpression
()
{
$q
=
new
Doctrine_Query
();
$q
->
from
(
'User'
)
->
where
(
"User.id NOT IN (FROM User(id) WHERE User.name = 'zYne')"
);
...
...
@@ -12,5 +46,9 @@ class Doctrine_Query_Subquery_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$users
->
count
(),
7
);
$this
->
assertEqual
(
$users
[
0
]
->
name
,
'Arnold Schwarzenegger'
);
}
public
function
testSubqueryAllowsSelectingOfAnyField
()
{
}
}
?>
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