Skip to content

fix: erro em phpunit.xml, melhorias nos testes, namespace para testes #17

New issue

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

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Ou rode o comando:
composer require geekcom/validator-docs
```

Agora execute o comando `composer update`.

Após a instalação, adicione no arquivo `config/app.php` no array `providers` a seguinte linha:

```php
Expand All @@ -44,7 +42,7 @@ a diferença é que agora, você terá os seguintes métodos de validação:
* **formato_cpf_cnpj** - Verifica se a mascara do CPF ou CNPJ é válida. ( 999.999.999-99 ) ou ( 99.999.999/9999-99 )


Então, podemos usar um simples teste onde dizemos que o campo CPF será obrigatório e usamos a biblioteca para validar:
Então, podemos realizar um simples teste onde dizemos que o campo CPF será obrigatório e usamos a biblioteca para validar:

```php
$this->validate($request, [
Expand Down
49 changes: 26 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
{
"name": "geekcom/validator-docs",
"description": "Biblioteca para validação de Título de Eleitor, CPF, CNPJ e CNH",
"license" : "MIT",
"authors": [
{
"name": "Daniel Rodrigues Lima",
"email": "[email protected]"
}
],
"require": {
"illuminate/support": "5.*"
},
"required-dev" : {
"laravel/framework": "5.*"
},
"autoload": {
"psr-4": {
"geekcom\\ValidatorDocs\\": "src/validator-docs"
}
},
"minimum-stability": "stable",
"require-dev": {
"laravel/laravel": "5.0.*"
"name": "geekcom/validator-docs",
"description": "Biblioteca para validação de Título de Eleitor, CPF, CNPJ e CNH",
"license": "MIT",
"authors": [
{
"name": "Daniel Rodrigues Lima",
"email": "[email protected]"
}
],
"require": {
"illuminate/support": "5.*"
},
"require-dev": {
"laravel/framework": "5.*",
"laravel/laravel": "5.0.*",
"phpunit/phpunit": "^7.5"
},
"autoload": {
"psr-4": {
"geekcom\\ValidatorDocs\\": "src/validator-docs"
}
},
"autoload-dev": {
"psr-4": {
"geekcom\\ValidatorDocs\\Tests\\": "tests"
}
}
}
8 changes: 3 additions & 5 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
stopOnFailure="false">
<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
Expand Down
Empty file removed tests/.gitkeep
Empty file.
4 changes: 3 additions & 1 deletion tests/TestValidator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

class TestValidator extends ValidatorTestCase
namespace geekcom\ValidatorDocs\Tests;

final class TestValidator extends ValidatorTestCase
{
public function testCpf()
{
Expand Down