faker()->words($this->faker->randomDigitNotNull())); $parameters = [ FieldParser::param() => [ $this->faker->word() => $fields->join(','), ], ]; $criteria = FieldParser::parse($parameters)[0]; static::assertInstanceOf(Criteria::class, $criteria); } /** * The Field Parser shall parse criteria type. * * @return void */ public function testParseType(): void { $type = $this->faker->word(); $fields = collect($this->faker()->words($this->faker->randomDigitNotNull())); $parameters = [ FieldParser::param() => [ $type => $fields->join(','), ], ]; $criteria = FieldParser::parse($parameters)[0]; static::assertEquals($type, $criteria->getType()); } /** * The Field Parser shall parse criteria fields. * * @return void */ public function testParseFields(): void { $fields = $this->faker()->words($this->faker->randomDigitNotNull()); $parameters = [ FieldParser::param() => [ $this->faker->word() => collect($fields)->join(','), ], ]; $criteria = FieldParser::parse($parameters)[0]; static::assertEquals($fields, $criteria->getFields()->all()); } }