Giter Club home page Giter Club logo

Comments (9)

JeffreyWay avatar JeffreyWay commented on July 28, 2024

Let me see your factories file.

from testdummy.

Luckyfox avatar Luckyfox commented on July 28, 2024

Hi Jeff,

I get the same issue as above. But when in iterm2 all works fine apart from 5 of these messages each time..

Warning: include_once(): Failed opening '/Users/nigel/projects/work/laravel/tests/functional' for inclusion (include_path='/Users/nigel/projects/work/laravel/vendor/phpunit/php-text-template:/Users/nigel/projects/work/laravel/vendor/phpunit/php-timer:/Users/nigel/projects/work/laravel/vendor/phpunit/php-file-iterator:.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/lib/php/PHPUnit/Util/Fileloader.php on line 95

Hope that might shed some light ont he issue..

from testdummy.

ruuter avatar ruuter commented on July 28, 2024

I'm getting same error, but only in remote server.
In my local installation all works fine without any problems.
Dumping composer autoload and clearing cache did not help.

$ php artisan db:seed -vvv --class=WishTableSeeder

[Laracasts\TestDummy\TestDummyException]
Could not locate a factory with the name: App\Models\Wish

Exception trace:

() at ...vendor/laracasts/testdummy/src/Builder.php:196
Laracasts\TestDummy\Builder->getFixture() at ...vendor/laracasts/testdummy/src/Builder.php:155
Laracasts\TestDummy\Builder->getAttributes() at ...vendor/laracasts/testdummy/src/Builder.php:96
Laracasts\TestDummy\Builder->build() at ...vendor/laracasts/testdummy/src/Builder.php:134
Laracasts\TestDummy\Builder->persist() at ...vendor/laracasts/testdummy/src/Builder.php:115
Laracasts\TestDummy\Builder->create() at ...database/seeds/WishTableSeeder.php:11

from testdummy.

antoniputra avatar antoniputra commented on July 28, 2024

I have the same issue. in my case, because the name of defineAs and factory method is different.
this happen for me after I change the namespaces of Model and I forgot to update the namespaces in factory() method

// ModelFactory.php
$factory->defineAs(App\Models\User::class, 'superadmin', function ($faker) use ($factory) {
    $user = $factory->raw(App\Models\User::class);

    return array_merge($user, config('site_default.users.superadmin'));
});
// UserSeeder.php file
factory('App\User', 'superadmin')->create();   // <---- I forget change this. should : App\Models\User
$this->command->comment(PHP_EOL .'User superadmin was generated...');

from testdummy.

ruuter avatar ruuter commented on July 28, 2024

@antoniputra
Unfortunately that is not a case for me, since everything is working in my local installation.
This happens only in remote server.

from testdummy.

antoniputra avatar antoniputra commented on July 28, 2024

oh, are you sure with your remote server environment set up ?

you are using external package, I don't familiar with this Exception. [Laracasts\TestDummy\TestDummyException]

can you show me your ModelFactories and WishTableSeeder code ?

from testdummy.

ruuter avatar ruuter commented on July 28, 2024

@antoniputra I am using Laracast/Testdummy, the very same package in which git repo we talk right now.
Yes, I'm positive this only happens in remote server. Not sure what can cause this. I'm trying to track this down right now.
One interesting thing I did not notice before is the fact that my whole factories.php file gets printed to stdout.

from testdummy.

ruuter avatar ruuter commented on July 28, 2024

I found it. It was PHP environment problem.
I have shortcode php start tag in factories.php and even though I do have short_open_tag = On in remote php, I did not have it On in php cli.
So it was PHP environment problem.

from testdummy.

antoniputra avatar antoniputra commented on July 28, 2024

glad hear it. :D

from testdummy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.