CodeExplorer StructForTests example
public function testSwGetAttributeJustProperty(): void
{ $object =
new ArrayStruct(['test' => 'value'
]);
$result =
sw_get_attribute($this->environmentMock,
new Source('', 'empty'
),
$object, 'test'
);
static::
assertEquals('value',
$result);
} public function testSwGetAttributeGetterMethods(): void
{ $object =
new StructForTests();
$object->
setNoGetter(99
);
$object->
setValue('valueValue'
);
$object->
setVisible(true
);
$result =
sw_get_attribute($this->environmentMock,
new Source('', 'empty'
),
$object, 'noGetter'
);
static::
assertNull($result);
$result =
sw_get_attribute($this->environmentMock,
new Source('', 'empty'
),
$object, 'value'
);
static::
assertEquals('valueValue',
$result);