Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Crudit Bundle Laravel Package

2lenet/crudit-bundle

Symfony bundle to rapidly build configurable CRUD back offices with SB Admin layout. Provides list views with pagination, sorting, actions, exports and batch ops, plus datasources, filters, menus, workflows, maps, markdown and Twig helpers.

View on GitHub
Deep Wiki
Context7

Test your application

Crudit gives you some helper traits in order to test your app.

Navigation test

A navigation test is provided. The test will navigate on every crud that appear in the menu. To enable the test create a new class in the tests directory :

#/tests/NavigationTest.php

<?php

namespace App\Tests;

use App\Repository\UserRepository;
use Lle\CruditBundle\Test\TestHelperTrait;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class NavigationTest extends WebTestCase
{
    use TestHelperTrait;

    public const EXCLUDED_ROUTES = ['hermes'];
    public const LOGIN_USER = 'admin@app.fr';
    public const USER_REPOSITORY = UserRepository::class;
}

There is 3 constants to setup in order to configure the test :

  • EXCLUDED_ROUTES The test will not access these routes.
  • LOGIN_USER The user to be used in the tests. Make sure that this user has the rights to access every pages.
  • USER_REPOSITORY The repository that manages users in the app.

Filter Test

The filter test will be useful to check that your filters are well configured.

Here is the class to set up:

#/tests/FiltersTest.php

<?php

namespace App\Tests;

use App\Repository\UserRepository;
use Lle\CruditBundle\Test\FilterTestHelperTrait;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class FiltersTest extends WebTestCase
{
    use FilterTestHelperTrait;
    
    public const LOGIN_USER = 'admin@app.fr';
    public const USER_REPOSITORY = UserRepository::class;
}

There is 2 constants to setup in order to configure the test :

  • LOGIN_USER The user to be used in the tests. Make sure that this user has the rights to access every pages.
  • USER_REPOSITORY The repository that manages users in the app.

Sortable test

To test the sort actions on the cruds, you can use the sortable test.

Here is the configuration:

#/tests/SortableTest.php

<?php

namespace App\Tests;

use Lle\CruditBundle\Test\TestSortableHelperTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

class SortableTest extends KernelTestCase
{
    use TestSortableHelperTrait;
}

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
bugban/php-sdk
littlerocket/job-queue-bundle
graham-campbell/flysystem
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
directorytree/opensearch-client
directorytree/opensearch-adapter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php