Author: hugo.hamon Date: 2010-02-11 20:51:20 +0100 (Thu, 11 Feb 2010) New Revision: 27922
Modified: doc/branches/1.4/jobeet/en/08.markdown doc/branches/1.4/jobeet/es/08.markdown doc/branches/1.4/jobeet/fr/08.markdown doc/branches/1.4/jobeet/it/08.markdown doc/branches/1.4/jobeet/ja/08.markdown doc/branches/1.4/jobeet/ru/08.markdown Log: [doc] updated chapter 8 of the Doctrine tutorial Modified: doc/branches/1.4/jobeet/en/08.markdown =================================================================== --- doc/branches/1.4/jobeet/en/08.markdown 2010-02-11 19:50:46 UTC (rev 27921) +++ doc/branches/1.4/jobeet/en/08.markdown 2010-02-11 19:51:20 UTC (rev 27922) @@ -1,14 +1,11 @@ Day 8: The Unit Tests ===================== -During the last two days, we reviewed all the features learned during the -first five days of the advent calendar to customize Jobeet features and add -new ones. In the process, we have also touched on other more advanced symfony -features. +During the last two chapters, we reviewed all the features learned during the +first five chapters of the Practical symfony book to customize Jobeet features and add new ones. In the process, we have also touched on other more advanced symfony features. Today, we will start talking about something completely different: automated -**tests**. As the topic is quite large, it will take us two full days to cover -everything. +**tests**. As the topic is quite large, it will take us two full chapters to cover everything. Tests in symfony ---------------- @@ -26,7 +23,7 @@ It contains two sub-directories, one for unit tests (`test/unit/`) and one for functional tests (`test/functional/`). -Unit tests will be covered in today's tutorial, whereas tomorrow's will be +Unit tests will be covered in this chapter, whereas the following will be dedicated to functional tests. Unit Tests @@ -100,7 +97,7 @@ >lies in much more explicit error messages in case of a failed test and in >improved readability of the tests. -The `lime_test` object also provides other convenient test methods: +The `lime_test` object also provides other convenient testing methods: Method | Description ----------------------- | -------------------------------------------------- @@ -219,7 +216,7 @@  -The test description string is also an valuable tool when trying to figure out +The test description string is also a valuable tool when trying to figure out what to test. You can see a pattern in the test strings: they are sentences describing how the method must behave and they always start with the method name to test. @@ -479,7 +476,7 @@ ### Test Data Now that we have a dedicated database for our tests, we need a way to load -some test data. During day 3, you learned to use the `propel:data-load` +some test data. During chapter 3, you learned to use the `propel:data-load` ~task|Tasks~, but for tests, we need to reload the data each time we run them to put the database in a known state. @@ -494,10 +491,10 @@ </propel> <doctrine> The `doctrine:data-load` task internally uses -the `Doctrine::loadData()` method to load the data: +the `Doctrine_Core::loadData()` method to load the data: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -537,7 +534,7 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> The script is pretty self-explanatory: @@ -564,10 +561,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - * We load our test data by using `Doctrine::loadData()`: + * We load our test data by using `Doctrine_Core::loadData()`: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -592,7 +589,7 @@ $job = JobeetJobPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $job = Doctrine::getTable('JobeetJob')->createQuery()->fetchOne(); + $job = Doctrine_Core::getTable('JobeetJob')->createQuery()->fetchOne(); </doctrine> $t->is($job->getCompanySlug(), Jobeet::slugify($job->getCompany()), '->getCompanySlug() return the slug for the company'); @@ -633,7 +630,7 @@ $category = JobeetCategoryPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $category = Doctrine::getTable('JobeetCategory') + $category = Doctrine_Core::getTable('JobeetCategory') ->createQuery() ->limit(1) ->fetchOne(); Modified: doc/branches/1.4/jobeet/es/08.markdown =================================================================== --- doc/branches/1.4/jobeet/es/08.markdown 2010-02-11 19:50:46 UTC (rev 27921) +++ doc/branches/1.4/jobeet/es/08.markdown 2010-02-11 19:51:20 UTC (rev 27922) @@ -386,10 +386,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> -La tarea `doctrine:data-load` internamente utiliza el método `Doctrine::loadData()` para cargar los datos: +La tarea `doctrine:data-load` internamente utiliza el método `Doctrine_Core::loadData()` para cargar los datos: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> @@ -426,7 +426,7 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> El script se explica bastante por sí mismo: @@ -449,10 +449,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - * Cargamos nuestros datos de prueba mediante el uso de `Doctrine::loadData()`: + * Cargamos nuestros datos de prueba mediante el uso de `Doctrine_Core::loadData()`: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -477,7 +477,7 @@ $job = JobeetJobPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $job = Doctrine::getTable('JobeetJob')->createQuery()->fetchOne(); + $job = Doctrine_Core::getTable('JobeetJob')->createQuery()->fetchOne(); </doctrine> $t->is($job->getCompanySlug(), Jobeet::slugify($job->getCompany()), '->getCompanySlug() return the slug for the company'); @@ -517,7 +517,7 @@ $category = JobeetCategoryPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $category = Doctrine::getTable('JobeetCategory') + $category = Doctrine_Core::getTable('JobeetCategory') ->createQuery() ->limit(1) ->fetchOne(); Modified: doc/branches/1.4/jobeet/fr/08.markdown =================================================================== --- doc/branches/1.4/jobeet/fr/08.markdown 2010-02-11 19:50:46 UTC (rev 27921) +++ doc/branches/1.4/jobeet/fr/08.markdown 2010-02-11 19:51:20 UTC (rev 27922) @@ -494,10 +494,10 @@ </propel> <doctrine> La tâche `doctrine:data-load` utilise en interne la -méthode `Doctrine::loadData()` pour charger les données : +méthode `Doctrine_Core::loadData()` pour charger les données : [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -537,7 +537,7 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> Le script est assez explicite : @@ -564,10 +564,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - * Nous chargeons nos données de test en utilisant `Doctrine::loadData()`: + * Nous chargeons nos données de test en utilisant `Doctrine_Core::loadData()`: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -592,7 +592,7 @@ $job = JobeetJobPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $job = Doctrine::getTable('JobeetJob')->createQuery()->fetchOne(); + $job = Doctrine_Core::getTable('JobeetJob')->createQuery()->fetchOne(); </doctrine> $t->is($job->getCompanySlug(), Jobeet::slugify($job->getCompany()), '->getCompanySlug() return the slug for the company'); @@ -633,7 +633,7 @@ $category = JobeetCategoryPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $category = Doctrine::getTable('JobeetCategory') + $category = Doctrine_Core::getTable('JobeetCategory') ->createQuery() ->limit(1) ->fetchOne(); Modified: doc/branches/1.4/jobeet/it/08.markdown =================================================================== --- doc/branches/1.4/jobeet/it/08.markdown 2010-02-11 19:50:46 UTC (rev 27921) +++ doc/branches/1.4/jobeet/it/08.markdown 2010-02-11 19:51:20 UTC (rev 27922) @@ -499,10 +499,10 @@ </propel> <doctrine> Il task `doctrine:data-load` usa internamente il metodo -`Doctrine::loadData()` per caricare i dati: +`Doctrine_Core::loadData()` per caricare i dati: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -542,7 +542,7 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> Lo script è praticamente auto-esplicante: @@ -567,10 +567,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - * Carichiamo i nostri dati di test usando `Doctrine::loadData()`: + * Carichiamo i nostri dati di test usando `Doctrine_Core::loadData()`: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -594,7 +594,7 @@ $job = JobeetJobPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $job = Doctrine::getTable('JobeetJob')->createQuery()->fetchOne(); + $job = Doctrine_Core::getTable('JobeetJob')->createQuery()->fetchOne(); </doctrine> $t->is($job->getCompanySlug(), Jobeet::slugify($job->getCompany()), '->getCompanySlug() return the slug for the company'); @@ -634,7 +634,7 @@ $category = JobeetCategoryPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $category = Doctrine::getTable('JobeetCategory') + $category = Doctrine_Core::getTable('JobeetCategory') ->createQuery() ->limit(1) ->fetchOne(); Modified: doc/branches/1.4/jobeet/ja/08.markdown =================================================================== --- doc/branches/1.4/jobeet/ja/08.markdown 2010-02-11 19:50:46 UTC (rev 27921) +++ doc/branches/1.4/jobeet/ja/08.markdown 2010-02-11 19:51:20 UTC (rev 27922) @@ -376,10 +376,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> -`doctrine:data-load` タスクは内部でデータをロードするために `Doctrine::loadData()` メソッドを使います: +`doctrine:data-load` タスクは内部でデータをロードするために `Doctrine_Core::loadData()` メソッドを使います: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -412,7 +412,7 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> スクリプトは自分自身をよく説明しています: @@ -437,10 +437,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - * `Doctrine::loadData()` を使ってテストデータをロードします: + * `Doctrine_Core::loadData()` を使ってテストデータをロードします: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -464,7 +464,7 @@ $job = JobeetJobPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $job = Doctrine::getTable('JobeetJob')->createQuery()->fetchOne(); + $job = Doctrine_Core::getTable('JobeetJob')->createQuery()->fetchOne(); </doctrine> $t->is($job->getCompanySlug(), Jobeet::slugify($job->getCompany()), '->getCompanySlug() return the slug for the company'); @@ -504,7 +504,7 @@ $category = JobeetCategoryPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $category = Doctrine::getTable('JobeetCategory') + $category = Doctrine_Core::getTable('JobeetCategory') ->createQuery() ->limit(1) ->fetchOne(); Modified: doc/branches/1.4/jobeet/ru/08.markdown =================================================================== --- doc/branches/1.4/jobeet/ru/08.markdown 2010-02-11 19:50:46 UTC (rev 27921) +++ doc/branches/1.4/jobeet/ru/08.markdown 2010-02-11 19:51:20 UTC (rev 27922) @@ -496,10 +496,10 @@ </propel> <doctrine> Команда `doctrine:data-load` для загрузки данных использует метод -`Doctrine::loadData()`: +`Doctrine_Core::loadData()`: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -539,7 +539,7 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> Приятно очевидный скрипт: @@ -566,10 +566,10 @@ $loader->loadData(sfConfig::get('sf_test_dir').'/fixtures'); </propel> <doctrine> - * Мы загружаем наши тестовые данные используя `Doctrine::loadData()`: + * Мы загружаем наши тестовые данные используя `Doctrine_Core::loadData()`: [php] - Doctrine::loadData(sfConfig::get('sf_test_dir').'/fixtures'); + Doctrine_Core::loadData(sfConfig::get('sf_test_dir').'/fixtures'); </doctrine> >**NOTE** @@ -593,7 +593,7 @@ $job = JobeetJobPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $job = Doctrine::getTable('JobeetJob')->createQuery()->fetchOne(); + $job = Doctrine_Core::getTable('JobeetJob')->createQuery()->fetchOne(); </doctrine> $t->is($job->getCompanySlug(), Jobeet::slugify($job->getCompany()), '->getCompanySlug() return the slug for the company'); @@ -635,7 +635,7 @@ $category = JobeetCategoryPeer::doSelectOne(new Criteria()); </propel> <doctrine> - $category = Doctrine::getTable('JobeetCategory') + $category = Doctrine_Core::getTable('JobeetCategory') ->createQuery() ->limit(1) ->fetchOne(); -- You received this message because you are subscribed to the Google Groups "symfony SVN" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-svn?hl=en.
