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
8ea7b0b8
Commit
8ea7b0b8
authored
Sep 21, 2006
by
pookey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
boolean test case added (currently fails on selecting when false)
parent
1862f00f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
+51
-0
BooleanTestCase.php
tests/BooleanTestCase.php
+43
-0
classes.php
tests/classes.php
+6
-0
run.php
tests/run.php
+2
-0
No files found.
tests/BooleanTestCase.php
0 → 100644
View file @
8ea7b0b8
<?php
class
Doctrine_BooleanTestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareData
()
{
}
public
function
prepareTables
()
{
$this
->
tables
=
array
(
"BooleanTest"
);
parent
::
prepareTables
();
}
public
function
testSet
()
{
$test
=
new
BooleanTest
();
$test
->
is_working
=
true
;
$this
->
assertEqual
(
$test
->
is_working
,
true
);
$test
->
save
();
$test
=
new
BooleanTest
();
$test
->
is_working
=
true
;
$test
->
save
();
$test
=
new
BooleanTest
();
$this
->
is_working
=
false
;
$this
->
assertEqual
(
$test
->
is_working
,
false
);
$test
->
save
();
$test
=
new
BooleanTest
();
$this
->
is_working
=
false
;
$test
->
save
();
$test
=
new
BooleanTest
();
$this
->
is_working
=
false
;
$test
->
save
();
$query
=
new
Doctrine_Query
(
$this
->
connection
);
$ret
=
$query
->
query
(
'FROM BooleanTest WHERE BooleanTest.is_working = ?'
,
array
(
false
));
$this
->
assertEqual
(
count
(
$ret
),
3
);
$query
=
new
Doctrine_Query
(
$this
->
connection
);
$ret
=
$query
->
query
(
'FROM BooleanTest WHERE BooleanTest.is_working = ?'
,
array
(
true
));
$this
->
assertEqual
(
count
(
$ret
),
2
);
}
}
?>
tests/classes.php
View file @
8ea7b0b8
...
...
@@ -438,4 +438,10 @@ class Phototag extends Doctrine_Record {
$this
->
hasColumn
(
"tag_id"
,
"integer"
);
}
}
class
BooleanTest
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'is_working'
,
'boolean'
);
}
}
?>
tests/run.php
View file @
8ea7b0b8
...
...
@@ -28,6 +28,7 @@ require_once("QueryReferenceModelTestCase.php");
require_once
(
"DBTestCase.php"
);
require_once
(
"SchemaTestCase.php"
);
require_once
(
"ImportTestCase.php"
);
require_once
(
"BooleanTestCase.php"
);
error_reporting
(
E_ALL
);
...
...
@@ -82,6 +83,7 @@ $test->addTestCase(new Doctrine_QueryTestCase());
$test
->
addTestCase
(
new
Doctrine_Query_ReferenceModel_TestCase
());
$test
->
addTestCase
(
new
Doctrine_BooleanTestCase
());
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
...
...
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