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
7c7645f8
Commit
7c7645f8
authored
Jul 25, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
e60c34c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
25 deletions
+46
-25
StateTestCase.php
tests/Record/StateTestCase.php
+46
-25
No files found.
tests/Record/StateTestCase.php
View file @
7c7645f8
...
@@ -30,11 +30,38 @@
...
@@ -30,11 +30,38 @@
* @since 1.0
* @since 1.0
* @version $Revision$
* @version $Revision$
*/
*/
class
Doctrine_Record_State_TestCase
extends
Doctrine_UnitTestCase
{
class
Doctrine_Record_State_TestCase
extends
Doctrine_UnitTestCase
public
function
prepareTables
()
{
}
{
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'Entity'
);
parent
::
prepareTables
();
}
public
function
prepareData
()
{
}
public
function
prepareData
()
{
}
public
function
testAssignUnknownState
()
{
public
function
testAssignFieldsToProxies
()
{
$user
=
new
User
();
$user
->
name
=
'someuser'
;
$user
->
password
=
'123'
;
$user
->
save
();
$this
->
connection
->
clear
();
$user
=
$this
->
connection
->
queryOne
(
"SELECT u.name FROM User u WHERE u.name = 'someuser'"
);
$this
->
assertEqual
(
$user
->
name
,
'someuser'
);
$user
->
name
=
'someother'
;
$this
->
assertEqual
(
$user
->
name
,
'someother'
);
$user
->
save
();
$this
->
assertEqual
(
$user
->
name
,
'someother'
);
}
public
function
testAssignUnknownState
()
{
$user
=
new
User
();
$user
=
new
User
();
try
{
try
{
$user
->
state
(
123123
);
$user
->
state
(
123123
);
...
@@ -52,7 +79,8 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -52,7 +79,8 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_TCLEAN
);
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_TCLEAN
);
}
}
public
function
testAssignDirtyState
()
{
public
function
testAssignDirtyState
()
{
$user
=
new
User
();
$user
=
new
User
();
$user
->
state
(
Doctrine_Record
::
STATE_DIRTY
);
$user
->
state
(
Doctrine_Record
::
STATE_DIRTY
);
...
@@ -63,7 +91,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -63,7 +91,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_DIRTY
);
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_DIRTY
);
}
}
public
function
testAssignCleanState
()
{
public
function
testAssignCleanState
()
{
$user
=
new
User
();
$user
=
new
User
();
$user
->
state
(
Doctrine_Record
::
STATE_CLEAN
);
$user
->
state
(
Doctrine_Record
::
STATE_CLEAN
);
...
@@ -74,7 +104,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -74,7 +104,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_CLEAN
);
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_CLEAN
);
}
}
public
function
testAssignTransientCleanState
()
{
public
function
testAssignTransientCleanState
()
{
$user
=
new
User
();
$user
=
new
User
();
$user
->
state
(
Doctrine_Record
::
STATE_TCLEAN
);
$user
->
state
(
Doctrine_Record
::
STATE_TCLEAN
);
...
@@ -85,7 +117,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -85,7 +117,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_TCLEAN
);
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_TCLEAN
);
}
}
public
function
testAssignTransientDirtyState
()
{
public
function
testAssignTransientDirtyState
()
{
$user
=
new
User
();
$user
=
new
User
();
$user
->
state
(
Doctrine_Record
::
STATE_TDIRTY
);
$user
->
state
(
Doctrine_Record
::
STATE_TDIRTY
);
...
@@ -96,7 +130,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -96,7 +130,9 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_TDIRTY
);
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_TDIRTY
);
}
}
public
function
testAssignProxyState
()
{
public
function
testAssignProxyState
()
{
$user
=
new
User
();
$user
=
new
User
();
$user
->
state
(
Doctrine_Record
::
STATE_PROXY
);
$user
->
state
(
Doctrine_Record
::
STATE_PROXY
);
...
@@ -107,6 +143,7 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -107,6 +143,7 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_PROXY
);
$this
->
assertEqual
(
$user
->
state
(),
Doctrine_Record
::
STATE_PROXY
);
}
}
public
function
testProxiesAreAutomaticallyUpdatedWithFetches
()
public
function
testProxiesAreAutomaticallyUpdatedWithFetches
()
{
{
$user
=
new
User
();
$user
=
new
User
();
...
@@ -130,20 +167,4 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
...
@@ -130,20 +167,4 @@ class Doctrine_Record_State_TestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$count
,
count
(
$this
->
dbh
));
$this
->
assertEqual
(
$count
,
count
(
$this
->
dbh
));
}
}
public
function
testAssignFieldsToProxies
()
{
$user
=
new
User
();
$user
->
name
=
'someuser'
;
$user
->
password
=
'123'
;
$user
->
save
();
$this
->
connection
->
clear
();
$user
=
$this
->
connection
->
queryOne
(
"SELECT u.name FROM User u WHERE u.name = 'someuser'"
);
$user
->
name
=
'someother'
;
$user
->
save
();
$this
->
assertEqual
(
$user
->
name
,
'someother'
);
}
}
}
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