Skip to content

Commit 5beebb0

Browse files
committed
#135 #137 correct assertion usage - stricter assertions
1 parent bd42ab4 commit 5beebb0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/Doctrine/Tests/Common/Annotations/AnnotationRegistryTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ public function testReset() : void
1818
$this->setStaticField($this->class, 'autoloadNamespaces', $data);
1919
$this->setStaticField($this->class, 'loaders', $data);
2020

21-
self::assertEquals($data, $this->getStaticField($this->class, 'autoloadNamespaces'));
22-
self::assertEquals($data, $this->getStaticField($this->class, 'loaders'));
21+
self::assertSame($data, $this->getStaticField($this->class, 'autoloadNamespaces'));
22+
self::assertSame($data, $this->getStaticField($this->class, 'loaders'));
2323

2424
AnnotationRegistry::reset();
2525

@@ -35,7 +35,7 @@ public function testRegisterAutoloadNamespaces() : void
3535
$this->setStaticField($this->class, 'autoloadNamespaces', array('foo' => 'bar'));
3636

3737
AnnotationRegistry::registerAutoloadNamespaces(array('test' => 'bar'));
38-
self::assertEquals(array('foo' => 'bar', 'test' => 'bar'), $this->getStaticField($this->class, 'autoloadNamespaces'));
38+
self::assertSame(array('foo' => 'bar', 'test' => 'bar'), $this->getStaticField($this->class, 'autoloadNamespaces'));
3939
}
4040

4141
/**
@@ -56,7 +56,7 @@ protected function setStaticField($class, $field, $value)
5656
$reflection->setValue(null, $value);
5757
}
5858

59-
protected function getStaticField($class, $field) : void
59+
protected function getStaticField($class, $field)
6060
{
6161
$reflection = new \ReflectionProperty($class, $field);
6262

@@ -80,7 +80,7 @@ public function testStopCallingLoadersIfClassIsNotFound() : void
8080
AnnotationRegistry::loadAnnotationClass('unloadableClass');
8181
AnnotationRegistry::loadAnnotationClass('unloadableClass');
8282
AnnotationRegistry::loadAnnotationClass('unloadableClass');
83-
$this->assertEquals(1, $i, 'Autoloader should only be called once');
83+
self::assertSame(1, $i, 'Autoloader should only be called once');
8484
}
8585

8686
/**
@@ -100,7 +100,7 @@ public function testStopCallingLoadersAfterClassIsFound() : void
100100
AnnotationRegistry::loadAnnotationClass($className);
101101
AnnotationRegistry::loadAnnotationClass($className);
102102
AnnotationRegistry::loadAnnotationClass($className);
103-
$this->assertEquals(1, $i, 'Autoloader should only be called once');
103+
self::assertSame(1, $i, 'Autoloader should only be called once');
104104
}
105105

106106
/**

0 commit comments

Comments
 (0)