assertNull($views->find( new Instrument(InstrumentType::COUNTER, 'name', null, null), new InstrumentationScope('name', null, null, Attributes::create([])), )); } /** * @psalm-suppress InvalidOperand */ public function test_registry_returns_matching_entry(): void { $views = new CriteriaViewRegistry(); $views->register(new InstrumentNameCriteria('name'), ViewTemplate::create()); $this->assertEquals( [ new ViewProjection('name', null, null, null, null), ], [...$views->find( new Instrument(InstrumentType::COUNTER, 'name', null, null), new InstrumentationScope('name', null, null, Attributes::create([])), )], ); } public function test_registry_does_not_return_not_matching_entry(): void { $views = new CriteriaViewRegistry(); $views->register(new InstrumentNameCriteria('foo'), ViewTemplate::create()); $this->assertNull($views->find( new Instrument(InstrumentType::COUNTER, 'name', null, null), new InstrumentationScope('name', null, null, Attributes::create([])), )); } }