Completed
Pull Request — master (#178)
by Corey
02:50
created

CheckinFormTest::testGetCustomBehaviors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 9
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace site\tests\unit\models;
4
5
use Yii;
6
use yii\helpers\ArrayHelper as AH;
7
8
class CheckinFormTest extends \Codeception\Test\Unit
9
{
10
    use \Codeception\Specify;
11
12
    public $behaviors = [
13
      1 => [
14
        'making eye contact' => [
15
          'id' => 7,
16
          'name' => 'making eye contact',
17
        ],
18
      ],
19
      2 => [
20
        'bored' => [
21
          'id' => 12,
22
          'name' => 'bored',
23
        ],
24
        'less time/energy for God, meetings, and church' => [
25
          'id' => 13,
26
          'name' => 'less time/energy for God, meetings, and church',
27
        ],
28
        'isolating yourself' => [
29
          'id' => 17,
30
          'name' => 'isolating yourself',
31
        ],
32
        'changes in goals' => [
33
          'id' => 18,
34
          'name' => 'changes in goals',
35
        ],
36
      ],
37
      3 => [
38
        'worry' => [
39
          'id' => 28,
40
          'name' => 'worry',
41
        ],
42
        'fantasy' => [
43
          'id' => 38,
44
          'name' => 'fantasy',
45
        ],
46
        'using over-the-counter medication for pain, sleep, and weight control' => [
47
          'id' => 46,
48
          'name' => 'using over-the-counter medication for pain, sleep, and weight control',
49
        ],
50
      ],
51
      4 => [
52
        'super busy' => [
53
          'id' => 47,
54
          'name' => 'super busy',
55
        ],
56
        'binge eating (usually at night]' => [
57
          'id' => 56,
58
          'name' => 'binge eating (usually at night]',
59
        ],
60
        'dramatic mood swings' => [
61
          'id' => 62,
62
          'name' => 'dramatic mood swings',
63
        ],
64
      ],
65
      5 => [
66
        'increased isolation' => [
67
          'id' => 78,
68
          'name' => 'increased isolation',
69
        ],
70
        'blaming' => [
71
          'id' => 79,
72
          'name' => 'blaming',
73
        ],
74
      ],
75
      6 => [
76
        'pessimistic' => [
77
          'id' => 104,
78
          'name' => 'pessimistic',
79
        ],
80
      ],
81
      7 => [
82
        'feeling you just can\'t manage without your coping behavior, at least for now' => [
83
          'id' => 128,
84
          'name' => 'feeling you just can\'t manage without your coping behavior, at least for now',
85
        ],
86
      ],
87
    ];
88
89
    /* fake custom behaviors */
90
    public $custom_behaviors = [
91
      1 => [
92
        'making eye contact' => [
93
          'id' => '777-custom',
94
          'name' => 'making eye contact',
95
        ],
96
      ],
97
      2 => [
98
        'bored' => [
99
          'id' => '12333-custom',
100
          'name' => 'bored',
101
        ],
102
        'less time/energy for God, meetings, and church' => [
103
          'id' => '11122333-custom',
104
          'name' => 'less time/energy for God, meetings, and church',
105
        ],
106
        'isolating yourself' => [
107
          'id' => '17777-custom',
108
          'name' => 'isolating yourself',
109
        ],
110
        'changes in goals' => [
111
          'id' => '11888-custom',
112
          'name' => 'changes in goals',
113
        ],
114
      ],
115
    ];
116
117
    protected function setUp() {
118
      $this->container = new \yii\di\Container;
0 ignored issues
show
Bug Best Practice introduced by
The property container does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
119
      $this->container->set('common\interfaces\UserBehaviorInterface', '\site\tests\_support\MockUserBehavior');
120
    $this->container->set('common\interfaces\TimeInterface', function () {
121
      return new \common\components\Time('America/Los_Angeles');
122
    });
123
      parent::setUp();
124
    }
125
126
		public function testAttributeLabels()
127
		{
128
        $this->specify('attributeLabels should function properly', function () {
129
          $model = $this->container->get('\site\models\CheckinForm');
130
          expect('attributeLabels should be correct', $this->assertEquals([
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...del->attributeLabels()) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
131
            'behaviors1' => 'Restoration',
132
            'behaviors2' => 'Forgetting Priorities',
133
            'behaviors3' => 'Anxiety',
134
            'behaviors4' => 'Speeding Up',
135
            'behaviors5' => 'Ticked Off',
136
            'behaviors6' => 'Exhausted',
137
            'behaviors7' => 'Relapsed/Moral Failure'
138
          ], $model->attributeLabels()));
139
        });
140
    }
141
142
    public function testSetBehaviors()
143
    {
144
        $this->specify('setBehaviors should function properly', function () {
145
          $model = $this->container->get('\site\models\CheckinForm');
146
147
					$model->setBehaviors($this->behaviors);
148
          expect('behaviors1 should be correct', $this->assertEquals([ 0 => 7 ], $model->behaviors1));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...7), $model->behaviors1) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
149
          expect('behaviors2 should be correct', $this->assertEquals([ 0 => 12, 1 => 13, 2 => 17, 3 => 18 ], $model->behaviors2));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...8), $model->behaviors2) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
150
          expect('behaviors3 should be correct', $this->assertEquals([ 0 => 28, 1 => 38, 2 => 46 ], $model->behaviors3));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...6), $model->behaviors3) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
151
          expect('behaviors4 should be correct', $this->assertEquals([ 0 => 47, 1 => 56, 2 => 62 ], $model->behaviors4));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...2), $model->behaviors4) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
152
          expect('behaviors5 should be correct', $this->assertEquals([ 0 => 78, 1 => 79 ], $model->behaviors5));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...9), $model->behaviors5) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
153
          expect('behaviors6 should be correct', $this->assertEquals([ 0 => 104 ], $model->behaviors6));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...4), $model->behaviors6) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
154
          expect('behaviors7 should be correct', $this->assertEquals([ 0 => 128 ], $model->behaviors7));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...8), $model->behaviors7) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
155
156
					$model->setBehaviors($this->behaviors);
157
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 7 ], $model->behaviors1));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...7), $model->behaviors1) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
158
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 12, 1 => 13, 2 => 17, 3 => 18 ], $model->behaviors2));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...8), $model->behaviors2) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
159
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 28, 1 => 38, 2 => 46 ], $model->behaviors3));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...6), $model->behaviors3) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
160
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 47, 1 => 56, 2 => 62 ], $model->behaviors4));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...2), $model->behaviors4) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
161
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 78, 1 => 79 ], $model->behaviors5));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...9), $model->behaviors5) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
162
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 104 ], $model->behaviors6));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...4), $model->behaviors6) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
163
          expect('setBehaviors should not append behaviors to existing ones', $this->assertEquals([ 0 => 128 ], $model->behaviors7));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...8), $model->behaviors7) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
164
        });
165
    }
166
167
		public function testValidateBehaviors()
168
		{
169
        $this->specify('validateBehaviors should function properly', function () {
170
          $model = $this->container->get('\site\models\CheckinForm');
171
					$model->setBehaviors($this->behaviors);
172
          expect('validation should be good', $this->assertTrue($model->validate()));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertTrue($model->validate()) targeting PHPUnit\Framework\Assert::assertTrue() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
173
174
          $model->behaviors1[0] = 'bad';
175
          expect('validation should be bad', $this->assertFalse($model->validate()));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertFalse($model->validate()) targeting PHPUnit\Framework\Assert::assertFalse() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
176
        });
177
		}
178
179
		public function testCompileBehaviors()
180
    {
181
      $model = $this->container->get('\site\models\CheckinForm');
182
      $model->setBehaviors($this->behaviors);
183
      expect('compiling behaviors should return a boolean true', $this->assertTrue($model->compileBehaviors()));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertTrue($model->compileBehaviors()) targeting PHPUnit\Framework\Assert::assertTrue() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
184
      expect('compiling behaviors should set the correct array', $this->assertEquals([
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...el->compiled_behaviors) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
185
                      7, 12, 13, 17, 18, 28, 38, 46, 47, 56, 62, 78, 79, 104, 128,
186
                    ], $model->compiled_behaviors));
187
188
      $model = $this->container->get('\site\models\CheckinForm');
189
      $model->setBehaviors($this->behaviors);
190
      $model->behaviors1[0] = null;
191
      $model->behaviors2[0] = null;
192
      $model->behaviors3[0] = null;
193
      $model->compileBehaviors();
194
          expect('compiling behaviors should strip out any falsy values', $this->assertEquals([
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...el->compiled_behaviors) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
195
											  	13, 17, 18, 38, 46, 47, 56, 62, 78, 79, 104, 128,
196
											  ], $model->compiled_behaviors));
197
198
      $model = $this->container->get('\site\models\CheckinForm');
199
      $model->setBehaviors([]);
200
      expect('compiling behaviors should return an empty array when no behaviors are set', $this->assertEmpty($model->compileBehaviors()));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEmpty($model->compileBehaviors()) targeting PHPUnit\Framework\Assert::assertEmpty() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
201
      expect('compiling behaviors should not set the compiled_behaviors array to anything when no behaviors are set', $this->assertEmpty($model->compiled_behaviors));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEmpty($model->compiled_behaviors) targeting PHPUnit\Framework\Assert::assertEmpty() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
202
203
      $model = $this->container->get('\site\models\CheckinForm');
204
      $model->setBehaviors($this->custom_behaviors);
205
      $model->compileBehaviors();
206
      expect('compiling behaviors should identify and set custom behaviors', $this->assertEquals(["777-custom", "12333-custom", "11122333-custom", "17777-custom", "11888-custom"], $model->custom_behaviors));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...odel->custom_behaviors) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
207
    }
208
209
    public function testGetCustomBehaviors() {
210
      $model = $this->container->get('\site\models\CheckinForm');
211
      $model->custom_behaviors = ["777-custom", "12333-custom", "11122333-custom", "17777-custom", "11888-custom"];
212
      expect('to return an array of extracted ids from an array of custom_behaviors', $this->assertEquals([777, 12333, 11122333, 17777, 11888], $model->getCustomBehaviors()));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...->getCustomBehaviors()) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
213
214
      $model = $this->container->get('\site\models\CheckinForm');
215
      $model->custom_behaviors = [];
216
      $model->compiled_behaviors = [ 1, 2, 3];
217
      expect('to return an empty array if no custom behaviors are set', $this->assertEquals([], $model->getCustomBehaviors()));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals(arra...->getCustomBehaviors()) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
218
    }
219
220
    public function testMergeWithDefault() {
221
      $model = $this->container->get('\site\models\CheckinForm');
222
223
      $base_behaviors = AH::index(Yii::$container->get(\common\models\Behavior::class)::$behaviors, 'name', "category_id");
224
      expect('mergeWithDefault should return the base behaviors when given an empty array', $this->assertEquals($base_behaviors, $model->mergeWithDefault([])));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals($bas...geWithDefault(array())) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
225
226
      $other_behaviors = [
227
        'some kind of really bad making eye contact' => [
228
          'id' => 400,
229
          'name' => 'some kind of really bad making eye contact',
230
          'category_id' => 7
231
        ]
232
      ];
233
      $expected_behaviors = $base_behaviors;
234
      $expected_behaviors[7] += $other_behaviors;
235
236
       expect('mergeWithDefault should return the given behaviors merged in with the base behaviors', $this->assertEquals($base_behaviors, $model->mergeWithDefault($other_behaviors)));
0 ignored issues
show
Bug introduced by
Are you sure the usage of $this->assertEquals($bas...ault($other_behaviors)) targeting PHPUnit\Framework\Assert::assertEquals() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
237
    }
238
}
239