<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/wordpress-mu-1.2.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Accessing Database in Unit Test with sfDoctrine</title>
	<link>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/</link>
	<description>Just another wp.omeeza.com weblog</description>
	<pubDate>Fri, 30 Jul 2010 00:53:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=wordpress-mu-1.2.5</generator>

	<item>
		<title>By: Kaizenlog » Database 30/07/2007</title>
		<link>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/#comment-31</link>
		<dc:creator>Kaizenlog » Database 30/07/2007</dc:creator>
		<pubDate>Fri, 28 Sep 2007 03:15:20 +0000</pubDate>
		<guid>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/#comment-31</guid>
		<description>&lt;p&gt;[...] Accessing Database in Unit Test with sfDoctrine By sunhwan  After made autoloading sfDoctrine available last week, I was thinking accessing database or pretending it (for test purpose) is surely easy. However, it wasn&#8217;t easy at all. So, here is the record of my struggle and, hopefully, &#8230; sunhwan - http://wp.omeeza.com/sunhwan [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[&#8230;] Accessing Database in Unit Test with sfDoctrine By sunhwan  After made autoloading sfDoctrine available last week, I was thinking accessing database or pretending it (for test purpose) is surely easy. However, it wasn&#8217;t easy at all. So, here is the record of my struggle and, hopefully, &#8230; sunhwan - <a href="http://wp.omeeza.com/sunhwan" rel="nofollow">http://wp.omeeza.com/sunhwan</a> [&#8230;]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Ding</title>
		<link>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/#comment-29</link>
		<dc:creator>Jonathan Ding</dc:creator>
		<pubDate>Thu, 27 Sep 2007 05:57:17 +0000</pubDate>
		<guid>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/#comment-29</guid>
		<description>&lt;p&gt;Your article looks good. And I find the solution you want, as below.
The major idea is that you should initialize the sfContext to get all dynamic stuff get created, while simple include the config.php to get all static settings correct.&lt;/p&gt;

&lt;p&gt;== the code ==
require_once(dirname(&lt;strong&gt;FILE&lt;/strong&gt;).'/../bootstrap/unit.php');&lt;/p&gt;

&lt;p&gt;define('SF_ROOT_DIR',    realpath(dirname(&lt;strong&gt;FILE&lt;/strong&gt;).'/..'));
define('SF_APP',         'frontend');&lt;/p&gt;

&lt;p&gt;// load the compiled Doctrine library
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'Doctrine.compiled.php');&lt;/p&gt;

&lt;p&gt;// it will configure the system, including autoload
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');&lt;/p&gt;

&lt;p&gt;// This initializes the context, it will initialize the database for you
sfContext::getInstance();&lt;/p&gt;

&lt;p&gt;$t = new lime_test(1, new lime_output_color())
// your tests ...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your article looks good. And I find the solution you want, as below.
The major idea is that you should initialize the sfContext to get all dynamic stuff get created, while simple include the config.php to get all static settings correct.</p>

<p>== the code ==
require_once(dirname(<strong>FILE</strong>).&#8217;/../bootstrap/unit.php&#8217;);</p>

<p>define(&#8217;SF_ROOT_DIR&#8217;,    realpath(dirname(<strong>FILE</strong>).&#8217;/..&#8217;));
define(&#8217;SF_APP&#8217;,         &#8216;frontend&#8217;);</p>

<p>// load the compiled Doctrine library
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.&#8217;lib&#8217;.DIRECTORY_SEPARATOR.&#8217;Doctrine.compiled.php&#8217;);</p>

<p>// it will configure the system, including autoload
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.&#8217;apps&#8217;.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.&#8217;config&#8217;.DIRECTORY_SEPARATOR.&#8217;config.php&#8217;);</p>

<p>// This initializes the context, it will initialize the database for you
sfContext::getInstance();</p>

<p>$t = new lime_test(1, new lime_output_color())
// your tests &#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Ding</title>
		<link>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/#comment-28</link>
		<dc:creator>Jonathan Ding</dc:creator>
		<pubDate>Thu, 27 Sep 2007 05:56:12 +0000</pubDate>
		<guid>http://wp.omeeza.com/sunhwan/2007/07/30/accessing-database-in-unit-test-with-sfdoctrine/#comment-28</guid>
		<description>&lt;p&gt;Your article looks good. And I find the solution you want, as below.
The major idea is that you should initialize the sfContext to get all dynamic stuff get created, while simple include the config.php to get all static settings correct.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your article looks good. And I find the solution you want, as below.
The major idea is that you should initialize the sfContext to get all dynamic stuff get created, while simple include the config.php to get all static settings correct.</p>]]></content:encoded>
	</item>
</channel>
</rss>
