1--TEST--
2SolrObject - checking illegal operation of modifying object
3--FILE--
4<?php
5
6$solrObject = new SolrObject();
7
8try
9{
10   @$solrObject->email = "iekpo@php.net";
11} catch (Exception $e) {
12    var_dump($e->getCode());
13    var_dump($e->getMessage());
14}
15
16try {
17	$solrObject['usingOffset'] = 'test';
18} catch (SolrIllegalOperationException $e) {
19	echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()) . PHP_EOL;
20}
21
22try {
23	$solrObject['newprop2_dimension_access'] = 'test';
24} catch (SolrIllegalOperationException $e) {
25	echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()) . PHP_EOL;
26}
27
28// unset
29try {
30	unset($solrObject->responseHeader);
31} catch (SolrIllegalOperationException $e) {
32	echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()) . PHP_EOL;
33}
34
35try {
36	unset($solrObject['responseHeader']);
37} catch (SolrIllegalOperationException $e) {
38	echo sprintf("Exception %d: %s", $e->getCode(), $e->getMessage()) . PHP_EOL;
39}
40
41?>
42--EXPECTF--
43int(1006)
44string(83) "SolrObject instances are read-only. Properties cannot be added, updated or removed."
45
46Warning: main(): Attempting to set value for [usingOffset] property in a SolrObject instance in %s on line %d
47Exception 1006: SolrObject instances are read-only. Properties cannot be added, updated or removed.
48
49Warning: main(): Attempting to set value for [newprop2_dimension_access] property in a SolrObject instance in %s on line %d
50Exception 1006: SolrObject instances are read-only. Properties cannot be added, updated or removed.
51Exception 1006: SolrObject instances are read-only. Properties cannot be added, updated or removed.
52
53Warning: main(): Attempting to remove [responseHeader] property in a SolrObject instance in %s on line %d
54Exception 1006: SolrObject instances are read-only. Properties cannot be added, updated or removed.
55