<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 19 May 2013 17:23:54 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Debuggable Blog: Testing Models in CakePHP - Now let's get rid of the unnecessary ModelTest classes!]]></title>
      <guid>http://www.phpdeveloper.org/news/10722</guid>
      <link>http://www.phpdeveloper.org/news/10722</link>
      <description><![CDATA[<p>
On the Debuggable blog today <i>Tim Koschutzki</i> <a href="http://www.debuggable.com/posts/testing-models-in-cakephp---now-let%27s-get-rid-of-the-unnecessary-modeltest-classes-!:4890ed55-be28-4d4a-ba4c-7fd64834cda3">looks at</a> another testing topics for the CakePHP framework - a cleaner way for testing models.
</p>
<blockquote>
Up until now there was always a need to create a so-called test model that extends your model-under-test in order to overwrite its $useDbConfig setting to be 'test_suite'. By that you ensured that your models run with the test_suite datasource when the tests are run. [...] Nate proposed ClassRegistry::config(), which allows you to tell the ClassRegistry class which datasource it shall use when
ClassRegistry::init() is used the next time (and thereby a model is instantiated).
</blockquote>
<p>
He includes an example of the new functionality - a test case ensuring that three articles are there and are marked as published. The registry makes it easier to automatically create the ArticleTest instance inside the test case rather than having to manually declare and define it.
</p>]]></description>
      <pubDate>Thu, 31 Jul 2008 07:51:38 -0500</pubDate>
    </item>
  </channel>
</rss>
