• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 10639694367

30 Aug 2024 10:03PM UTC coverage: 7.667% (+0.7%) from 6.957%
10639694367

push

github

web-flow
Merge 3.4

Merge 3.4

0 of 165 new or added lines in 5 files covered. (0.0%)

7500 existing lines in 290 files now uncovered.

12514 of 163211 relevant lines covered (7.67%)

22.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Metadata/Tests/Util/CloneTraitTest.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Metadata\Tests\Util;
15

16
use ApiPlatform\Metadata\Util\CloneTrait;
17
use PHPUnit\Framework\TestCase;
18

19
/**
20
 * @author Quentin Barloy <quentin.barloy@gmail.com>
21
 */
22
class CloneTraitTest extends TestCase
23
{
24
    use CloneTrait;
25

26
    public function testScalarClone(): void
27
    {
NEW
28
        $this->assertSame(5, $this->clone(5));
×
29
    }
30

31
    public function testObjectClone(): void
32
    {
NEW
33
        $data = new \stdClass();
×
NEW
34
        $result = $this->clone($data);
×
35

NEW
36
        $this->assertNotSame($data, $result);
×
NEW
37
        $this->assertEquals($data, $result);
×
38
    }
39

40
    public function testGeneratorClone(): void
41
    {
NEW
42
        $this->assertNull($this->clone($this->generator()));
×
43
    }
44

45
    private function generator(): \Generator
46
    {
NEW
47
        yield 1;
×
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc