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
9589f486
Commit
9589f486
authored
Oct 02, 2006
by
pookey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pookey: added boolean test cases for setting null values
parent
aa25b57e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
BooleanTestCase.php
tests/BooleanTestCase.php
+23
-0
classes.php
tests/classes.php
+1
-0
No files found.
tests/BooleanTestCase.php
View file @
9589f486
...
@@ -5,6 +5,29 @@ class Doctrine_BooleanTestCase extends Doctrine_UnitTestCase {
...
@@ -5,6 +5,29 @@ class Doctrine_BooleanTestCase extends Doctrine_UnitTestCase {
$this
->
tables
=
array
(
"BooleanTest"
);
$this
->
tables
=
array
(
"BooleanTest"
);
parent
::
prepareTables
();
parent
::
prepareTables
();
}
}
public
function
testSetNull
()
{
$test
=
new
BooleanTest
();
$this
->
is_working
=
null
;
$this
->
assertEqual
(
$this
->
is_working
,
null
);
$this
->
assertEqual
(
$test
->
getState
(),
Doctrine_Record
::
STATE_TDIRTY
);
$test
->
save
();
$test
->
refresh
();
$this
->
assertEqual
(
$test
->
is_working
,
null
);
$test
=
new
BooleanTest
();
$this
->
is_working_notnull
=
null
;
$this
->
assertEqual
(
$this
->
is_working_notnull
,
false
);
$this
->
assertEqual
(
$test
->
getState
(),
Doctrine_Record
::
STATE_TDIRTY
);
$test
->
save
();
$test
->
refresh
();
$this
->
assertEqual
(
$test
->
is_working_notnull
,
false
);
}
public
function
testSetFalse
()
{
public
function
testSetFalse
()
{
$test
=
new
BooleanTest
();
$test
=
new
BooleanTest
();
$test
->
is_working
=
false
;
$test
->
is_working
=
false
;
...
...
tests/classes.php
View file @
9589f486
...
@@ -458,6 +458,7 @@ class Phototag extends Doctrine_Record {
...
@@ -458,6 +458,7 @@ class Phototag extends Doctrine_Record {
class
BooleanTest
extends
Doctrine_Record
{
class
BooleanTest
extends
Doctrine_Record
{
public
function
setTableDefinition
()
{
public
function
setTableDefinition
()
{
$this
->
hasColumn
(
'is_working'
,
'boolean'
);
$this
->
hasColumn
(
'is_working'
,
'boolean'
);
$this
->
hasColumn
(
'is_working_notnull'
,
'boolean'
,
1
,
array
(
'default'
=>
false
,
'notnull'
=>
true
));
}
}
}
}
class
Data_File
extends
Doctrine_Record
{
class
Data_File
extends
Doctrine_Record
{
...
...
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