# Fixture from tuto

**URL:** <https://discourse.cakephp.org/t/fixture-from-tuto/2346>\
**Category:** Testing\
**Created:** [April 4, 2017, 11:13am UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346 "2017-04-04T11:13:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent.f](https://avatars.discourse-cdn.com/v4/letter/v/5f8ce5/32.png) [@vincent.f](https://discourse.cakephp.org/u/vincent.f)\
**Post date:** [April 4, 2017, 11:13am UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346/1 "2017-04-04T11:13:21Z")

</div>

Hello,

I would like to use fixture for my test.  
I have made the 1st tutorial about articles (posts) and tests tuto too. But it does not work and I really do not understand what I have to do to run fixtures tests.  
More clearly, I do not understand this error :  
.Exception: Unable to insert fixtures for “App\Test\TestCase\Controller\ArticlesControllerTest” test case. SQLSTATE[HY000] [2002] No such file or directory in […www/vendor/cakephp/cakephp/src/TestSuite/Fixture/FixtureManager.php, line 348]

Every posts on stackoverflow speak about the configuration of my database which is :  
‘test’ =\> [  
‘className’ =\> ‘Cake\Database\Connection’,  
‘driver’ =\> ‘Cake\Database\Driver\Mysql’,  
‘persistent’ =\> false,  
‘host’ =\> ‘localhost’,  
//‘port’ =\> ‘non\_standard\_port\_number’,  
‘username’ =\> ‘root’,  
‘password’ =\> ‘root’,  
‘database’ =\> ‘tmp\_test’,  
‘encoding’ =\> ‘utf8’,  
‘timezone’ =\> ‘UTC’,  
‘cacheMetadata’ =\> true,  
‘quoteIdentifiers’ =\> false,  
‘log’ =\> false,  
//‘init’ =\> [‘SET GLOBAL innodb\_stats\_on\_metadata = 0’],  
‘url’ =\> env(‘DATABASE\_TEST\_URL’, null),  
],

Have you some website with tuto to help me or the solution ?

Thank you,

Vincent.

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [April 4, 2017, 2:40pm UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346/2 "2017-04-04T14:40:23Z")

</div>

What is in this file?

> [@vincent.f](#):
>
> App\Test\TestCase\Controller\ArticlesControllerTest

---

<div class="post-metadata">

**Author:** ![vincent.f](https://avatars.discourse-cdn.com/v4/letter/v/5f8ce5/32.png) [@vincent.f](https://discourse.cakephp.org/u/vincent.f)\
**Post date:** [April 4, 2017, 2:58pm UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346/3 "2017-04-04T14:58:02Z")

</div>

Hello,

I have tried to run this tutorial : [https://book.cakephp.org/3.0/en/development/testing.html](https://book.cakephp.org/3.0/en/development/testing.html)

I have got :  
 ![](https://canada1.discourse-cdn.com/flex029/uploads/cakephp/original/1X/9fabfa5079afd5013c139332e22fc7eb79fbbd5d.png)

Thank you.

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [April 5, 2017, 12:55pm UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346/4 "2017-04-05T12:55:40Z")

</div>

This seems to ok.

What is in your `/tests/Fixture/ArticlesFixture.php` ?

---

<div class="post-metadata">

**Author:** ![vincent.f](https://avatars.discourse-cdn.com/v4/letter/v/5f8ce5/32.png) [@vincent.f](https://discourse.cakephp.org/u/vincent.f)\
**Post date:** [April 6, 2017, 7:59am UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346/5 "2017-04-06T07:59:38Z")

</div>

Hello,

Thank you for your help, I do not find any solution. Below, my file ArticleFixture.

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex029/uploads/cakephp/original/1X/65c580f967402987048054092d993ba93d941842.png)

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [April 6, 2017, 8:23am UTC](https://discourse.cakephp.org/t/fixture-from-tuto/2346/6 "2017-04-06T08:23:28Z")

</div>

> [@vincent.f](#):
>
> Below, my file ArticleFixture.

Is your file really ArticleFixture or AticlesFixture.php? It should be in prular, eg ArticlesFixture.php
