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
a73a73da
Commit
a73a73da
authored
Dec 01, 2007
by
jackbravo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tickets #583 and #576
parent
338bd78e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
3 deletions
+96
-3
Record.php
lib/Doctrine/Record.php
+3
-3
576TestCase.php
tests/Ticket/576TestCase.php
+52
-0
583TestCase.php
tests/Ticket/583TestCase.php
+39
-0
run.php
tests/run.php
+2
-0
No files found.
lib/Doctrine/Record.php
View file @
a73a73da
...
@@ -436,10 +436,10 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
...
@@ -436,10 +436,10 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
$data
=
array
();
$data
=
array
();
foreach
(
$this
->
getTable
()
->
getFieldNames
()
as
$fieldName
)
{
foreach
(
$this
->
getTable
()
->
getFieldNames
()
as
$fieldName
)
{
if
(
!
isset
(
$tmp
[
$fieldName
]))
{
if
(
isset
(
$tmp
[
$fieldName
]))
{
$data
[
$fieldName
]
=
self
::
$_null
;
}
else
{
$data
[
$fieldName
]
=
$tmp
[
$fieldName
];
$data
[
$fieldName
]
=
$tmp
[
$fieldName
];
}
else
if
(
!
isset
(
$this
->
_data
[
$fieldName
]))
{
$data
[
$fieldName
]
=
self
::
$_null
;
}
}
unset
(
$tmp
[
$fieldName
]);
unset
(
$tmp
[
$fieldName
]);
}
}
...
...
tests/Ticket/576TestCase.php
0 → 100644
View file @
a73a73da
<?php
/**
* Doctrine_Ticket_587_TestCase
*
* @package Doctrine
* @author Joaquin Bravo <jackbravo@gmail.com>
* @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_Ticket_576_TestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'Entity'
);
parent
::
prepareTables
();
}
public
function
prepareData
()
{
}
public
function
testInit
()
{
$entity
=
new
Entity
();
$entity
->
name
=
'myname'
;
$entity
->
loginname
=
'test'
;
$entity
->
save
();
}
public
function
testBug
()
{
// load our user and our collection of pages
$user
=
Doctrine_Query
::
create
()
->
from
(
'Entity'
)
->
fetchOne
();
$this
->
assertEqual
(
$user
->
name
,
'myname'
);
$this
->
assertEqual
(
$user
->
loginname
,
'test'
);
$user
->
name
=
null
;
$this
->
assertEqual
(
$user
->
name
,
null
);
$data
=
Doctrine_Query
::
create
()
->
select
(
'name'
)
->
from
(
'Entity'
)
->
fetchOne
(
array
(),
Doctrine
::
FETCH_ARRAY
);
$user
->
hydrate
(
$data
);
$this
->
assertEqual
(
$user
->
name
,
'myname'
);
$this
->
assertEqual
(
$user
->
loginname
,
'test'
);
// <<----- this is what the bug is about
}
}
tests/Ticket/583TestCase.php
0 → 100644
View file @
a73a73da
<?php
/**
* Doctrine_Ticket_587_TestCase
*
* @package Doctrine
* @author Joaquin Bravo <jackbravo@gmail.com>
* @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_Ticket_583_TestCase
extends
Doctrine_UnitTestCase
{
public
function
prepareTables
()
{
$this
->
tables
=
array
(
'Entity'
);
parent
::
prepareTables
();
}
public
function
prepareData
()
{
}
public
function
testBug
()
{
$entity
=
new
Entity
();
$entity
->
name
=
'myname'
;
$entity
->
save
();
// load our user and our collection of pages
$user
=
Doctrine_Query
::
create
()
->
select
(
'id'
)
->
from
(
'Entity'
)
->
fetchOne
();
$this
->
assertEqual
(
$user
->
name
,
'myname'
);
// load our user and our collection of pages
$user
=
Doctrine_Query
::
create
()
->
select
(
'*'
)
->
from
(
'Entity'
)
->
fetchOne
();
$this
->
assertEqual
(
$user
->
name
,
'myname'
);
}
}
tests/run.php
View file @
a73a73da
...
@@ -15,6 +15,8 @@ $tickets->addTestCase(new Doctrine_Ticket_Njero_TestCase());
...
@@ -15,6 +15,8 @@ $tickets->addTestCase(new Doctrine_Ticket_Njero_TestCase());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_428_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_428_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_480_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_480_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_587_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_587_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_576_TestCase
());
$tickets
->
addTestCase
(
new
Doctrine_Ticket_583_TestCase
());
//If you write a ticket testcase add it here like shown above!
//If you write a ticket testcase add it here like shown above!
$test
->
addTestCase
(
$tickets
);
$test
->
addTestCase
(
$tickets
);
...
...
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