@@ -244,7 +244,6 @@ discard block |
||
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | /** |
| 247 | - * @param string $class |
|
| 248 | 247 | * @return ClassMetadata |
| 249 | 248 | */ |
| 250 | 249 | protected function _createValidClassMetadata() |
@@ -456,6 +455,10 @@ discard block |
||
| 456 | 455 | return $this->mockMetadata[$className]; |
| 457 | 456 | } |
| 458 | 457 | |
| 458 | + /** |
|
| 459 | + * @param string $className |
|
| 460 | + * @param ClassMetadata $metadata |
|
| 461 | + */ |
|
| 459 | 462 | public function setMetadataForClass($className, $metadata) |
| 460 | 463 | { |
| 461 | 464 | $this->mockMetadata[$className] = $metadata; |
@@ -2,9 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Shitty\Tests\ORM\Mapping; |
| 4 | 4 | |
| 5 | -use Shitty\ORM\Mapping\ClassMetadata, |
|
| 6 | - Shitty\ORM\Mapping\Driver\XmlDriver, |
|
| 7 | - Shitty\ORM\Mapping\Driver\YamlDriver; |
|
| 5 | +use Shitty\ORM\Mapping\ClassMetadata; |
|
| 6 | +use Shitty\ORM\Mapping\Driver\YamlDriver; |
|
| 8 | 7 | |
| 9 | 8 | class YamlMappingDriverTest extends AbstractMappingDriverTest |
| 10 | 9 | { |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Shitty\Tests\ORM\Performance; |
| 4 | 4 | |
| 5 | -use Shitty\Tests\Mocks\HydratorMockStatement, |
|
| 6 | - Shitty\ORM\Query\ResultSetMapping, |
|
| 7 | - Shitty\ORM\Query; |
|
| 5 | +use Shitty\Tests\Mocks\HydratorMockStatement; |
|
| 6 | +use Shitty\ORM\Query\ResultSetMapping; |
|
| 7 | +use Shitty\ORM\Query; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * Tests to prevent serious performance regressions. |
@@ -2,14 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Shitty\Tests\ORM\Performance; |
| 4 | 4 | |
| 5 | -use Shitty\ORM\Tools\SchemaTool; |
|
| 6 | -use Shitty\ORM\Query; |
|
| 7 | 5 | use Shitty\Tests\Models\CMS\CmsUser; |
| 8 | -use Shitty\Tests\Models\CMS\CmsPhonenumber; |
|
| 9 | -use Shitty\Tests\Models\CMS\CmsAddress; |
|
| 10 | 6 | use Shitty\Tests\Models\CMS\CmsGroup; |
| 11 | 7 | use Shitty\Tests\Models\CMS\CmsArticle; |
| 12 | -use Shitty\Tests\Models\CMS\CmsComment; |
|
| 13 | 8 | |
| 14 | 9 | /** |
| 15 | 10 | * @group performance |
@@ -124,6 +124,9 @@ discard block |
||
| 124 | 124 | $this->assertEquals(503, $this->countQuery($em)); |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $label |
|
| 129 | + */ |
|
| 127 | 130 | private function queryEntity(EntityManagerInterface $em, $label) |
| 128 | 131 | { |
| 129 | 132 | $times = 100; |
@@ -155,6 +158,9 @@ discard block |
||
| 155 | 158 | printf("\n%s\n", str_repeat('-', 50)); |
| 156 | 159 | } |
| 157 | 160 | |
| 161 | + /** |
|
| 162 | + * @param string $label |
|
| 163 | + */ |
|
| 158 | 164 | public function findEntityOneToMany(EntityManagerInterface $em, $label) |
| 159 | 165 | { |
| 160 | 166 | $times = 50; |
@@ -214,6 +220,9 @@ discard block |
||
| 214 | 220 | printf("\n%s\n", str_repeat('-', 50)); |
| 215 | 221 | } |
| 216 | 222 | |
| 223 | + /** |
|
| 224 | + * @param string $label |
|
| 225 | + */ |
|
| 217 | 226 | private function findEntity(EntityManagerInterface $em, $label) |
| 218 | 227 | { |
| 219 | 228 | $times = 10; |
@@ -249,6 +258,9 @@ discard block |
||
| 249 | 258 | printf("\n%s\n", str_repeat('-', 50)); |
| 250 | 259 | } |
| 251 | 260 | |
| 261 | + /** |
|
| 262 | + * @param string $label |
|
| 263 | + */ |
|
| 252 | 264 | private function findAllEntity(EntityManagerInterface $em, $label) |
| 253 | 265 | { |
| 254 | 266 | $times = 100; |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Shitty\ORM\EntityNotFoundException; |
| 6 | 6 | use Shitty\ORM\Mapping\ClassMetadata; |
| 7 | 7 | use Shitty\ORM\Proxy\ProxyFactory; |
| 8 | -use Shitty\Common\Proxy\ProxyGenerator; |
|
| 9 | 8 | use Shitty\Tests\Mocks\ConnectionMock; |
| 10 | 9 | use Shitty\Tests\Mocks\EntityManagerMock; |
| 11 | 10 | use Shitty\Tests\Mocks\UnitOfWorkMock; |
@@ -51,6 +51,10 @@ |
||
| 51 | 51 | $this->_em = $this->_getTestEntityManager(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | + /** |
|
| 55 | + * @param string $dqlToBeTested |
|
| 56 | + * @param string $sqlToBeConfirmed |
|
| 57 | + */ |
|
| 54 | 58 | public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) |
| 55 | 59 | { |
| 56 | 60 | try { |
@@ -51,6 +51,10 @@ |
||
| 51 | 51 | $this->_em = $this->_getTestEntityManager(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | + /** |
|
| 55 | + * @param string $dqlToBeTested |
|
| 56 | + * @param string $sqlToBeConfirmed |
|
| 57 | + */ |
|
| 54 | 58 | public function assertSqlGeneration($dqlToBeTested, $sqlToBeConfirmed) |
| 55 | 59 | { |
| 56 | 60 | try { |
@@ -17,6 +17,9 @@ discard block |
||
| 17 | 17 | $this->_em = $this->_getTestEntityManager(); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $dql |
|
| 22 | + */ |
|
| 20 | 23 | public function assertValidDQL($dql, $debug = false) |
| 21 | 24 | { |
| 22 | 25 | try { |
@@ -30,6 +33,9 @@ discard block |
||
| 30 | 33 | } |
| 31 | 34 | } |
| 32 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $dql |
|
| 38 | + */ |
|
| 33 | 39 | public function assertInvalidDQL($dql, $debug = false) |
| 34 | 40 | { |
| 35 | 41 | try { |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | namespace Shitty\Tests\ORM\Query; |
| 3 | 3 | |
| 4 | 4 | use Shitty\ORM\EntityManagerInterface; |
| 5 | -use Shitty\ORM\Query, |
|
| 6 | - Shitty\ORM\Query\QueryException; |
|
| 5 | +use Shitty\ORM\Query; |
|
| 6 | +use Shitty\ORM\Query\QueryException; |
|
| 7 | 7 | |
| 8 | 8 | class LanguageRecognitionTest extends \Shitty\Tests\OrmTestCase |
| 9 | 9 | { |