We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgt
I have this test:
/** @test **/ public function store_category() { // Arrange $root = factory(\App\Category::class)->create( ['name' => 'Root', 'depth' => 0]); // Act $response = $this->actingAsAdmin('api') ->json('POST', $this->endpoint, [ 'name' => 'New Category', 'parent_id' => $root->id, ]); // Assert $response->assertStatus(200); $response->assertJson([ 'tree' => [ 'root' => true, 'name' => 'Root', 'children' => [ [ 'name' => 'New Category', 'lft' => 2, 'rgt' => 3 ] ] ] ]); $this->assertDatabaseHas('categories', [ 'name' => 'New Category', 'slug' => 'new-category', 'lft' => 2, 'rgt' => 3 ]); $this->assertDatabaseHas('categories', [ 'name' => 'Root', 'lft' => 1, 'rgt' => 4 ]); }
This works on PHP 7.0 and PHP 7.1 but fails with PHP 7.2
To get the test to pass on PHP 7.2 the last assertion (the one checking the root in the database) has to be changed to below
$this->assertDatabaseHas('categories', [ 'name' => 'Root', 'lft' => 1, 'rgt' => 3 ]);
The actual store function in my app
public function store(CreateCategoryRequest $request) { $parent = $request->input('parent_id'); $category = new Category; $category->fill($request->all()); $category->save(); $category->makeChildOf($parent); return $this->categoryTree($request, $category); }
The text was updated successfully, but these errors were encountered:
This seems to be a problem with SQLite on PHP 7.2, test is working as expected when using a MySQL-database.
Sorry, something went wrong.
same issue php 7.0, mysql
No branches or pull requests
Wrong
rgt
-value when creating child node on PHP 7.2I have this test:
This works on PHP 7.0 and PHP 7.1 but fails with PHP 7.2
To get the test to pass on PHP 7.2 the last assertion (the one checking the root in the database) has to be changed to below
The actual store function in my app
The text was updated successfully, but these errors were encountered: