@@ -37,7 +37,13 @@ public function testHybrid()
37
37
R::setAllowHybridMode ( FALSE );
38
38
$ book ->title = 'Tales of a misfit ' ;
39
39
try {
40
- R::store ( $ book );
40
+ R::store ( $ book , TRUE );
41
+ fail ();
42
+ } catch (\Exception $ e ) {
43
+ pass ();
44
+ }
45
+ try {
46
+ R::store ( $ book , FALSE );
41
47
fail ();
42
48
} catch (\Exception $ e ) {
43
49
pass ();
@@ -48,6 +54,18 @@ public function testHybrid()
48
54
$ book ->title = 'Tales of a misfit ' ;
49
55
try {
50
56
R::store ( $ book );
57
+ fail ();
58
+ } catch (\Exception $ e ) {
59
+ pass ();
60
+ }
61
+ try {
62
+ R::store ( $ book , FALSE );
63
+ fail ();
64
+ } catch (\Exception $ e ) {
65
+ pass ();
66
+ }
67
+ try {
68
+ R::store ( $ book , TRUE );
51
69
pass ();
52
70
} catch (\Exception $ e ) {
53
71
fail ();
@@ -71,24 +89,28 @@ public function testHybridDataType()
71
89
if ($ this ->currentlyActiveDriverID == 'sqlite ' ) return ;
72
90
$ book = R::dispense ('book ' );
73
91
$ book ->pages = 1 ;
74
- $ id = R::store ( $ book );
92
+ $ id = R::store ( $ book, TRUE );
75
93
R::freeze ( TRUE );
94
+ asrt ( R::getRedBean ()->isFrozen (), TRUE );
76
95
R::setAllowHybridMode ( FALSE );
77
96
$ book ->pages = 'too many ' ;
78
97
try {
79
- R::store ( $ book );
98
+ R::store ( $ book, TRUE );
80
99
fail ();
81
100
} catch (\Exception $ e ) {
82
101
pass ();
83
102
}
103
+ asrt ( R::getRedBean ()->isFrozen (), TRUE );
84
104
R::setAllowHybridMode ( TRUE );
105
+ asrt ( R::getRedBean ()->isFrozen (), TRUE );
85
106
R::debug (1 );
86
107
try {
87
- R::store ( $ book );
108
+ R::store ( $ book, TRUE );
88
109
pass ();
89
110
} catch (\Exception $ e ) {
90
111
fail ();
91
112
}
113
+ asrt ( R::getRedBean ()->isFrozen (), TRUE );
92
114
$ book = $ book ->fresh ();
93
115
echo $ book ;
94
116
asrt ( $ book ->pages , 'too many ' );
@@ -109,7 +131,7 @@ public function testHybridNonSQLException()
109
131
R::freeze ( TRUE );
110
132
R::setAllowHybridMode ( TRUE );
111
133
try {
112
- R::store ( $ toy );
134
+ R::store ( $ toy, TRUE );
113
135
fail ();
114
136
} catch (\Exception $ e ) {
115
137
pass ();
@@ -120,7 +142,7 @@ public function testHybridNonSQLException()
120
142
R::freeze ( TRUE );
121
143
R::setAllowHybridMode ( TRUE );
122
144
try {
123
- R::store ( $ toy );
145
+ R::store ( $ toy, TRUE );
124
146
pass ();
125
147
} catch (\Exception $ e ) {
126
148
fail ();
0 commit comments