Commit e21281ae authored by zYne's avatar zYne

fixed formatting

parent 632f85ba
<?php <?php
/* /*
* $Id$ * $Id$
* %s *
* 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_Ticket343_TestCase
* *
* @package Doctrine * @package Doctrine
* @author Lloyd Leung (lleung at carlton decimal ca) * @author Lloyd Leung (lleung at carlton decimal ca)
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping * @category Object Relational Mapping
* @link www.phpdoctrine.com * @link www.phpdoctrine.com
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Revision$
*/ */
class Doctrine_Ticket343_TestCase extends Doctrine_UnitTestCase
{
public function prepareData()
{ }
public function prepareTables()
{ }
public function testForeignPkNonId()
{
$member = new Member();
$subprogram = new SubProgram();
$newsblast = new NewsBlast();
$member->set('name','hello world!');
$member->set('pin', 'demo1100');
$subprogram->set('name', 'SoemthingNew');
$newsblast->set('pin', $member);
$newsblast->set('subprogram', $subprogram);
$newsblast->set('title', 'Some title here');
$newsblast->save();
$test->assertEqual($newsblast['subprogram'], 'SomethingNew');
$test->assertEqual($newsblast['member']['pin'], 'demo1100');
$test->assertEqual($newsblast['member']['name'], 'hello world!');
$test->assertEqual(0,1);
}
}
class Member extends Doctrine_Record class Member extends Doctrine_Record
...@@ -30,7 +79,6 @@ class Member extends Doctrine_Record ...@@ -30,7 +79,6 @@ class Member extends Doctrine_Record
{ {
$this->hasMany('NewsBlast as news_blasts', 'NewsBlast.pin'); $this->hasMany('NewsBlast as news_blasts', 'NewsBlast.pin');
} }
} }
...@@ -50,10 +98,7 @@ class NewsBlast extends Doctrine_Record ...@@ -50,10 +98,7 @@ class NewsBlast extends Doctrine_Record
$this->hasOne('SubProgram as subprogram', 'NewsBlast.subprogram_id', 'id'); $this->hasOne('SubProgram as subprogram', 'NewsBlast.subprogram_id', 'id');
$this->hasOne('Member as member', 'NewsBlast.pin', 'pin'); $this->hasOne('Member as member', 'NewsBlast.pin', 'pin');
} }
} }
class SubProgram extends Doctrine_Record class SubProgram extends Doctrine_Record
{ {
const DATABASE_NAME = 'doctrine'; const DATABASE_NAME = 'doctrine';
...@@ -70,38 +115,3 @@ class SubProgram extends Doctrine_Record ...@@ -70,38 +115,3 @@ class SubProgram extends Doctrine_Record
} }
} }
class Doctrine_Ticket343_TestCase extends Doctrine_UnitTestCase
{
public function prepareData()
{ }
public function prepareTables()
{ }
public function testForeignPkNonId()
{
die('happy!');
$member = new Member();
$subprogram = new SubProgram();
$newsblast = new NewsBlast();
$member->set('name','hello world!');
$member->set('pin', 'demo1100');
$subprogram->set('name', 'SoemthingNew');
$newsblast->set('pin', $member);
$newsblast->set('subprogram', $subprogram);
$newsblast->set('title', 'Some title here');
$newsblast->save();
$test->assertEqual($newsblast['subprogram'], 'SomethingNew');
$test->assertEqual($newsblast['member']['pin'], 'demo1100');
$test->assertEqual($newsblast['member']['name'], 'hello world!');
$test->assertEqual(0,1);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment