3 namespace RedUNIT\Base;
5 use RedUNIT\Base as Base;
6 use RedBeanPHP\Facade as R;
7 use RedBeanPHP\RedException as RedException;
12 * Tests whether this specific issue on github has been resolved.
13 * Test whether we have two different exception messages for
14 * properties and values.
16 * @file RedUNIT/Base/Issue303.php
17 * @desc Issue #303 - Split bean property exception.
18 * @author Gabor de Mooij and the RedBeanPHP Community
19 * @license New BSD/GPLv2
21 * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
22 * This source file is subject to the New BSD/GPLv2 License that is bundled
23 * with this source code in the file license.txt.
25 class Issue303 extends Base
28 * Test whether we have two different exception messages for
29 * properties and values.
33 public function testIssue303()
35 testpack( 'Testing Issue #303 - Test splitting bean exception property/value.' );
38 R::store( R::dispense( 'invalidbean' )->setAttr( 'invalid.property', 'value' ) );
40 } catch (RedException $e ) {
41 asrt( $e->getMessage(), 'Invalid Bean property: property invalid.property' );
45 R::store( R::dispense( 'invalidbean' )->setAttr( 'property', array() ) );
47 } catch (RedException $e ) {
48 asrt( $e->getMessage(), 'Invalid Bean value: property property' );
52 R::store( R::dispense( 'invalidbean' )->setAttr( 'property', new \stdClass ) );
54 } catch (RedException $e ) {
55 asrt( $e->getMessage(), 'Invalid Bean value: property property' );