Google\Cloud\Tests\Vision\AnnotationTest::testConstruct PHP Méthode

testConstruct() public méthode

public testConstruct ( )
    public function testConstruct()
    {
        $res = ['faceAnnotations' => [['landmarks' => []]], 'landmarkAnnotations' => ['foo' => ['bat' => 'bar']], 'logoAnnotations' => ['foo' => ['bat' => 'bar']], 'labelAnnotations' => ['foo' => ['bat' => 'bar']], 'textAnnotations' => ['foo' => ['bat' => 'bar']], 'safeSearchAnnotation' => ['foo' => ['bat' => 'bar']], 'imagePropertiesAnnotation' => ['foo' => ['bat' => 'bar']], 'error' => ['foo' => ['bat' => 'bar']]];
        $ann = new Annotation($res);
        $this->assertInstanceOf(Face::class, $ann->faces()[0]);
        $this->assertInstanceOf(Entity::class, $ann->landmarks()[0]);
        $this->assertInstanceOf(Entity::class, $ann->logos()[0]);
        $this->assertInstanceOf(Entity::class, $ann->labels()[0]);
        $this->assertInstanceOf(Entity::class, $ann->text()[0]);
        $this->assertInstanceOf(SafeSearch::class, $ann->safeSearch());
        $this->assertInstanceOf(ImageProperties::class, $ann->imageProperties());
        $this->assertEquals($res['error'], $ann->error());
        $this->assertEquals($res, $ann->info());
    }
AnnotationTest