Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class DuplicateHeadersExceptionSpec extends ObjectBehavior
{
function let()
{
$this->beConstructedWith(['header1', 'header2']);
}
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\DuplicateHeadersException');
}
function it_is_a_reader_exception()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\ReaderException');
}
function it_has_a_message()
{
$this->getMessage()->shouldReturn('File contains duplicate headers: header1, header2');
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class MappingExceptionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\MappingException');
}
function it_is_an_exception()
{
$this->shouldHaveType('Exception');
$this->shouldImplement('Ddeboer\DataImport\Exception');
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class ReaderExceptionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\ReaderException');
}
function it_is_an_exception()
{
$this->shouldHaveType('Exception');
$this->shouldImplement('Ddeboer\DataImport\Exception');
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class SourceNotFoundExceptionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\SourceNotFoundException');
}
function it_is_an_exception()
{
$this->shouldHaveType('Exception');
$this->shouldImplement('Ddeboer\DataImport\Exception');
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class UnexpectedTypeExceptionSpec extends ObjectBehavior
{
public function let()
{
$this->beConstructedWith(123, 'string');
}
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\UnexpectedTypeException');
}
function it_is_an_unexpected_value_exception()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\UnexpectedValueException');
}
function it_has_a_message_with_scalar_type()
{
$this->getMessage()->shouldReturn('Expected argument of type "string", "integer" given');
}
function it_has_a_message_with_object_type()
{
$this->beConstructedWith(new \stdClass, 'string');
$this->getMessage()->shouldReturn('Expected argument of type "string", "stdClass" given');
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class UnexpectedValueExceptionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\UnexpectedValueException');
}
function it_is_an_exception()
{
$this->shouldImplement('Ddeboer\DataImport\Exception');
}
}

View File

@@ -0,0 +1,35 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
use Symfony\Component\Validator\ConstraintViolationListInterface;
class ValidationExceptionSpec extends ObjectBehavior
{
function let(ConstraintViolationListInterface $list)
{
$this->beConstructedWith($list, 1);
}
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\ValidationException');
}
function it_is_an_exception()
{
$this->shouldHaveType('Exception');
$this->shouldImplement('Ddeboer\DataImport\Exception');
}
function it_has_a_list_of_violations(ConstraintViolationListInterface $list)
{
$this->getViolations()->shouldReturn($list);
}
function it_has_a_line_number()
{
$this->getLineNumber()->shouldReturn(1);
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace spec\Ddeboer\DataImport\Exception;
use PhpSpec\ObjectBehavior;
class WriterExceptionSpec extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType('Ddeboer\DataImport\Exception\WriterException');
}
function it_is_an_exception()
{
$this->shouldHaveType('Exception');
$this->shouldImplement('Ddeboer\DataImport\Exception');
}
}