|
4 | 4 |
|
5 | 5 | namespace Yiisoft\Db\Tests; |
6 | 6 |
|
7 | | -use Closure; |
8 | 7 | use PHPUnit\Framework\TestCase; |
9 | 8 | use Throwable; |
10 | 9 | use Yiisoft\Db\Exception\Exception; |
@@ -754,65 +753,6 @@ public function testColumnWithIndexBy(): void |
754 | 753 | ], $query->column()); |
755 | 754 | } |
756 | 755 |
|
757 | | - /** |
758 | | - * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::populate |
759 | | - */ |
760 | | - public function testPopulate(array $rows): void |
761 | | - { |
762 | | - $db = $this->getConnection(false); |
763 | | - $query = (new Query($db)); |
764 | | - |
765 | | - $this->assertSame($rows, $query->populate($rows)); |
766 | | - } |
767 | | - |
768 | | - /** |
769 | | - * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::populateWithIndexBy |
770 | | - * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::populateWithIncorrectIndexBy |
771 | | - * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::populateWithIndexByClosure |
772 | | - */ |
773 | | - public function testPopulateWithIndexBy(Closure|string|null $indexBy, array $rows, array $populated): void |
774 | | - { |
775 | | - $db = $this->getConnection(false); |
776 | | - $query = (new Query($db))->indexBy($indexBy); |
777 | | - |
778 | | - $this->assertSame($populated, $query->populate($rows)); |
779 | | - } |
780 | | - |
781 | | - /** |
782 | | - * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::populateWithIndexBy |
783 | | - */ |
784 | | - public function testPopulateWithIndexByWithObject(Closure|string|null $indexBy, array $rows, array $expectedPopulated): void |
785 | | - { |
786 | | - $db = $this->getConnection(false); |
787 | | - $query = (new Query($db))->indexBy($indexBy); |
788 | | - |
789 | | - $rows = json_decode(json_encode($rows)); |
790 | | - $populated = json_decode(json_encode($query->populate($rows)), true); |
791 | | - |
792 | | - $this->assertSame($expectedPopulated, $populated); |
793 | | - } |
794 | | - |
795 | | - /** |
796 | | - * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::populateWithIncorrectIndexBy |
797 | | - */ |
798 | | - public function testPopulateWithIncorrectIndexByWithObject(Closure|string|null $indexBy, array $rows): void |
799 | | - { |
800 | | - $db = $this->getConnection(false); |
801 | | - $query = (new Query($db))->indexBy($indexBy); |
802 | | - |
803 | | - $rows = json_decode(json_encode($rows)); |
804 | | - |
805 | | - set_error_handler(static function (int $errno, string $errstr) { |
806 | | - throw new \Exception('E_WARNING: ' . $errstr, $errno); |
807 | | - }, E_WARNING); |
808 | | - |
809 | | - $this->expectExceptionMessageMatches('/^E_WARNING: /'); |
810 | | - |
811 | | - $query->populate($rows); |
812 | | - |
813 | | - restore_error_handler(); |
814 | | - } |
815 | | - |
816 | 756 | /** |
817 | 757 | * @dataProvider \Yiisoft\Db\Tests\Provider\QueryProvider::filterConditionData |
818 | 758 | */ |
|
0 commit comments