Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove some unneeded checks/tests #24876

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
Nov 9, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;

abstract class BaseDateTimeTransformer implements DataTransformerInterface
{
Expand All @@ -33,19 +32,10 @@ abstract class BaseDateTimeTransformer implements DataTransformerInterface
* @param string $inputTimezone The name of the input timezone
* @param string $outputTimezone The name of the output timezone
*
* @throws UnexpectedTypeException if a timezone is not a string
* @throws InvalidArgumentException if a timezone is not valid
*/
public function __construct(string $inputTimezone = null, string $outputTimezone = null)
{
if (null !== $inputTimezone && !is_string($inputTimezone)) {
throw new UnexpectedTypeException($inputTimezone, 'string');
}

if (null !== $outputTimezone && !is_string($outputTimezone)) {
throw new UnexpectedTypeException($outputTimezone, 'string');
}

$this->inputTimezone = $inputTimezone ?: date_default_timezone_get();
$this->outputTimezone = $outputTimezone ?: date_default_timezone_get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;

use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;

/**
* Transforms between a normalized time and a localized time string/array.
Expand All @@ -31,8 +30,6 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
* @param string $outputTimezone The output timezone
* @param array $fields The date fields
* @param bool $pad Whether to use padding
*
* @throws UnexpectedTypeException if a timezone is not a string
*/
public function __construct(string $inputTimezone = null, string $outputTimezone = null, array $fields = null, bool $pad = false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;

use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;

/**
* Transforms between a date string and a DateTime object.
Expand Down Expand Up @@ -48,8 +47,6 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
* @param string $inputTimezone The name of the input timezone
* @param string $outputTimezone The name of the output timezone
* @param string $format The date format
*
* @throws UnexpectedTypeException if a timezone is not a string
*/
public function __construct(string $inputTimezone = null, string $outputTimezone = null, string $format = 'Y-m-d H:i:s')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,6 @@ public function testReverseTransformWrapsIntlErrors()
$transformer->reverseTransform('12345');
}

/**
* @expectedException \TypeError
*/
public function testValidateDateFormatOption()
{
new DateTimeToLocalizedStringTransformer(null, null, 'foobar');
}

/**
* @expectedException \TypeError
*/
public function testValidateTimeFormatOption()
{
new DateTimeToLocalizedStringTransformer(null, null, null, 'foobar');
}

/**
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
*/
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyAccess\Tests\Fixtures\ReturnTyped;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClass;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicCall;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassMagicGet;
use Symfony\Component\PropertyAccess\Tests\Fixtures\Ticket5775Object;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassSetValue;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassIsWritable;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TestClassTypeErrorInsideCall;
use Symfony\Component\PropertyAccess\Tests\Fixtures\TypeHinted;

class PropertyAccessorTest extends TestCase
Expand Down Expand Up @@ -634,24 +632,4 @@ public function setFoo($foo)

return $obj;
}

/**
* @expectedException \TypeError
*/
public function testThrowTypeErrorInsideSetterCall()
{
$object = new TestClassTypeErrorInsideCall();

$this->propertyAccessor->setValue($object, 'property', 'foo');
}

/**
* @expectedException \TypeError
*/
public function testDoNotDiscardReturnTypeError()
{
$object = new ReturnTyped();

$this->propertyAccessor->setValue($object, 'foos', array(new \DateTime()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ public function testConstructor()
$this->assertTrue($token->isAuthenticated());
}

/**
* @expectedException \TypeError
*/
public function testConstructorSecretCannotBeNull()
{
new RememberMeToken(
$this->getUser(),
null,
null
);
}

/**
* @expectedException \InvalidArgumentException
*/
Expand Down
8 changes: 0 additions & 8 deletions src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,6 @@ public function testStartTime()
$this->assertEquals(0, $event->getStartTime(), null, self::DELTA);
}

/**
* @expectedException \TypeError
*/
public function testInvalidOriginThrowsAnException()
{
new StopwatchEvent('abc');
}

public function testHumanRepresentation()
{
$event = new StopwatchEvent(microtime(true) * 1000);
Expand Down