Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Thomas S. Benjamin
    @tomb10516
    Hey folks! I have what is probably a dumb question, but I don't yet know enough about this project to figure this out for myself. The issue is that I have some tests that are failing on a vanilla checkout of V1.2.5. Here is an example of one of the tests that fails:
    tomb@metal {1.2.5} ~/NeoEloquent$ phpunit -c phpunit.xml --filter testAttachingModelInstance
    gives me an assertion failure on line: /home/tomb/NeoEloquent/tests/functional/BelongsToManyRelationTest.php:118 where the failure is that $user->roles()->edge($role)) should be null but is actually the instance of an EdgeIn object.
    What am I doing wrong?
    Abed Halawi
    @Mulkave
    @tomb10516 when u call $user->roles()->edge($role) what you are asking for is the edge between the $user and the $role which is why you’re getting an EdgeIn instance, if there was no existing relationship between both you would’ve gotten null. BTW the EdgeIn instance means that it’s an incoming relationship starting from the $role towards the $user
    Thomas S. Benjamin
    @tomb10516
    So what am I doing wrong in running the test? This isn't my code, it is the unmodified test from 1.2.5 Shouldn't the test succeed? I understand what the line of code does, I am using it as an example of one of the 5 tests that fail when I try and run the full suite of tests on an unmodified checkout of 1.2.5
    Abed Halawi
    @Mulkave
    oh well, not sure about that. Can you push your code on some branch and I’ll take a look
    Thomas S. Benjamin
    @tomb10516
    This is commit 7bd1c6fb1acd3a66a1b68ea3e718bc473e6ecd38 on the Vinlab/NeoEloquent 2.1.5 branch. This is why I am asking whether there is something I am doing wrong with my testing. This is not my code, this is the head of 2.1.5
    Thomas S. Benjamin
    @tomb10516

    I'd REALLY like some help with the problems I am having with testing. I have a patch for issue 49 and I'd love to generate a pull request, but I don't want to do that without testing.

    I'd like to emphasize again this is NOT A PROBLEM WITH MY CODE, it is a problem I'm having with testing. The problems occur with a clean checkout of the vinelab code.

    Detailed info on my problem including versions, etc: https://github.com/tomb10516/NeoEloquent/wiki/Testing-Problems

    Abed Halawi
    @Mulkave
    @tomb10516 will take a stab at ur branch first thing in the morning tomorrow. 👍🏻
    Abed Halawi
    @Mulkave
    @tomb10516 was able to reproduce your issues, on it.
    Abed Halawi
    @Mulkave
    @tomb10516 all good now, most of the fails were due to incompatibility with updates on illuminate’s side which is a good thing :smile:
    Thomas S. Benjamin
    @tomb10516
    Thank you so much! This is going to make NeoEloquent dev so much easier for me!
    Abed Halawi
    @Mulkave
    Awesome! Looking forward
    Thomas S. Benjamin
    @tomb10516
    So do we have regression tests to check new code against both L5.1 and L5.0? The problems surrounding #104 is making me ask. If we don't have them, if someone could point me towards the scripts we use for regression tests on older versions of PHP I might make scripts to check multiple versions of Eloquent.
    Abed Halawi
    @Mulkave
    Usually we have functional and unit tests, nothing specific for older versions of PHP or Laravel. We use the 1.1. branch for L4 support and 1.2. for L5 support. Hope this answers your concers.
    Thomas S. Benjamin
    @tomb10516
    @Mulkave I'm getting some failed tests in a clean checkout of NeoEloquent with a fresh composer update.
    5 tests are failing. the first of these is: Vinelab\NeoEloquent\Tests\Functional\Relations\BelongsToMany\BelongsToManyRelationTest::testAttachingModelInstance
    Abed Halawi
    @Mulkave
    @tomb10516 that’s really weird, I’ll take a stab at it tomorrow for sure
    Thomas S. Benjamin
    @tomb10516
    @Mulkave Thanks!
    Another question: What coding standard are you using? I'd like to make my autoformatting match yours. Right now I'm fixing the formatting by hand before doing diffs / pull requests. We have recently adopted PSR2 since Laravel has done so in 5.1 Are you going to move towards that (perhaps in 1.5)?
    Abed Halawi
    @Mulkave
    @tomb10516 in NeoEloquent 1.x we were using Laravel’s coding standards that were mentioned in their docs, as for 1.5 that’s correct, we’re moving to PSR2.
    Ebrahim Imami
    @imami

    Hi , I'm new to NeoEloquent , I have created a Migration file using command : " php artisan neo4j:make:migration create_user_label "

    in up() method , I dont know how to add some default nodes. could anyone here help me with this?

    Ivan Moroz
    @menvil
    Hi
    Ebrahim Imami
    @imami
    Is anybody online here ?
    Ebrahim Imami
    @imami

    I want to make e query based on relations attributes , using NeoEloquent.
    for example , all (Actors) who ACTED_IN a (Movie) as scpecific role...

    I know the cypher syntax , but I dont know witch NeoEloquent method should I use ?

    anybody can help me?

    I want to run queries such as following , but not by Cypher.
    By NeoEloquent methods

    MATCH (a:Actor)-[r:ACTED_IN]->(m:Movie) WHERE r.role='James' return a,r,m;

    Koen Calliauw
    @kcalliauw
    Hi all. I'm trying to use transactions in our tests for NeoEloquent. Wrapping everything in a DB::beginTransaction( function () { } ) seems to work fine, but it has to be repeated in every test. Is there some way I can use DB::beginTransaction() and DB::rollBack() in setUp and teardown and have it actually work?
    We're using 1.3.1
    For example, outside the tests, this fails:
    Route::get('/test', function () {
        \DB::beginTransaction();
        factory(\App\User::class)->create(['email'=>'test@test.com', 'password'=>  bcrypt('123')]);
        \DB::rollBack();
    });
    well, it works, but the record is still in the DB after it finishes, so the transaction committed, or never started perhaps
    Koen Calliauw
    @kcalliauw
    @Mulkave Can you shed some light on how to use these transactions?
    Thijs de Haan
    @tieskedh
    Hi, I've a question:
    I saw an issue about a whererel feature.
    I also saw that it was implemented at a different fork.
    I need it at a schoolproject.
    Is there a way to get it to work already?
    Abed Halawi
    @Mulkave
    @kcalliauw usually it is recommended that you start your tests on a clean slate (nothing in the database) so the way we usually do it is clear everything from the database on tearDown instead of having to delete every record when created, since it is more difficult to maintain
    Abed Halawi
    @Mulkave
    @tieskedh that’s true it was being implemented by @tomb10516 but he’s handed it to someone else. That implementation will be merged into the next release of NeoEloquent which will take place very soon. Unfortunately this can only be done by using custom queries and then you’ll have to do the mapping yourself. This should help with the implementation meanwhile Vinelab/NeoEloquent#26
    Koen Calliauw
    @kcalliauw
    Hi @Mulkave yes that's how we tackled it in the end. But it's a bit of a hassle, since multiple instances of Neo4J on the same machine is a serious pain to set up.
    We ended up using a docker container with Neo4J in it
    Abed Halawi
    @Mulkave
    good to hear you were able to work it out!
    Thijs de Haan
    @tieskedh
    @Mulkave thx
    Victor Macedo de Moura
    @victormacedo
    Hi! someone already tried to use NeoEloquent outside Laravel? In my project i use Eloquent for MySQL and outside Laravel normally, but for Neo4j i was having some problems
    Abed Halawi
    @Mulkave
    @victormacedo It is possible to do so. Check this example: https://github.com/Vinelab/NeoEloquent/tree/2.0.0-alpha/Examples/Movies
    happy to help if you still face difficulties.
    jy2008
    @jy2008
    Is there a good tutorial on Eloquent that you know of that will tell me how to a specific CRUD? what i am trying to do here is to have each user only be able to view, update and delete their own form and some of the fields of the form?
    itay9001
    @itay9001
    New to the graph world alert Hey, when i try to create a node from model that as constraint i get "node with label and property="sss"" already exists, but an empty node created after all! can someone help with that please?
    Using laravel 5 btw
    itay9001
    @itay9001
    someone?
    Abed Halawi
    @Mulkave
    @jy2008 @itay9001 sorry for the late reply, the discussion have moved to the Neo4j Slack Group under the channel #neo4j-php or DM if you wish
    Will update the docs accordingly