33 lines
651 B
PHP
33 lines
651 B
PHP
--TEST--
|
|
Test for `Internal\Scalar`.
|
|
--SKIPIF--
|
|
<?php
|
|
require_once 'includes/loaded.php';
|
|
is_php_arma_loaded();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require_once 'includes/assert.php';
|
|
|
|
$mat = Arma\IMat::fromString('1 2; 3 4');
|
|
$mat(1, 0)->setTo(5);
|
|
$mat->at(0, 1)->setTo(7);
|
|
batch_assert('read/write access of `MapVal`',
|
|
[5, $mat->at(1, 0)->val()],
|
|
[7, $mat(0, 1)->val()]
|
|
);
|
|
|
|
// When parent class is destroyed...
|
|
$orphaned_mapval = Arma\IMat::fromString('1 2; 3 4')->at(1, 1);
|
|
batch_assert('orphaned `MapVal`',
|
|
[$orphaned_mapval->val(), 4]
|
|
);
|
|
$orphaned_mapval->setTo(7);
|
|
batch_assert('orphaned `MapVal`',
|
|
[$orphaned_mapval->val(), 7]
|
|
);
|
|
|
|
?>
|
|
--EXPECT--
|