DrawMyAttention\ResourceGenerator\Commands\ResourceGeneratorTest::it_accepts_attributes_which_are_saved_to_the_model PHP Method

it_accepts_attributes_which_are_saved_to_the_model() public method

    public function it_accepts_attributes_which_are_saved_to_the_model()
    {
        $model = 'Koala';
        // When I create a new model called 'Animal'.
        $this->runArtisanCommand(ResourceMakeCommand::class, ['name' => $model, 'attributes' => 'name:string,100|age:integer,unsigned,index|colour:string,20,nullable|nickname']);
        // Then the model is created and the model has the correct namespace
        $instance = $this->createClassInstance($model);
        $this->assertEquals([['name' => 'name', 'properties' => ['string', '100']], ['name' => 'age', 'properties' => ['integer', 'unsigned', 'index']], ['name' => 'colour', 'properties' => ['string', '20', 'nullable']], ['name' => 'nickname', 'properties' => []]], $instance->migrationAttributes());
        $this->clearGeneratedFiles($model);
    }