From e8ea25371ccee5f3dc1aa6b8967227886b65250f Mon Sep 17 00:00:00 2001 From: "Nathanael d. Noblet" Date: Wed, 29 Jul 2015 16:46:53 -0600 Subject: [PATCH] fix datetime value converter --- .../DateTimeToStringValueConverterTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Ddeboer/DataImport/Tests/ValueConverter/DateTimeToStringValueConverterTest.php b/tests/Ddeboer/DataImport/Tests/ValueConverter/DateTimeToStringValueConverterTest.php index 39264251..4f90ea32 100644 --- a/tests/Ddeboer/DataImport/Tests/ValueConverter/DateTimeToStringValueConverterTest.php +++ b/tests/Ddeboer/DataImport/Tests/ValueConverter/DateTimeToStringValueConverterTest.php @@ -3,22 +3,23 @@ namespace Ddeboer\DataImport\Tests\ValueConverter; use Ddeboer\DataImport\ValueConverter\DateTimeToStringValueConverter; +use Ddeboer\DataImport\ValueConverter\DateTimeValueConverter; class DateTimeToStringValueConverterTest extends \PHPUnit_Framework_TestCase { public function testConvertWithoutOutputFormatReturnsString() { $value = new \DateTime('2010-01-01 01:00:00'); - $converter = new DateTimeToStringValueConverter; - $output = $converter->convert($value); + $converter = new DateTimeValueConverter(); + $output = $converter->__invoke($value); $this->assertEquals('2010-01-01 01:00:00', $value->format('Y-m-d H:i:s')); } public function testInvalidInputFormatThrowsException() { $value = '14/10/2008 09:40:20'; - $converter = new DateTimeToStringValueConverter; + $converter = new DateTimeValueConverter(); $this->setExpectedException("UnexpectedValueException", "Input must be DateTime object."); - $converter->convert($value); + $converter->__invoke($value); } }