original_string: protected function bindExpectedToObject()
      {
          $accessor = PropertyAccess::createPropertyAccessor();
  
          $values = array_merge($this->expectedValues, $this->expectedMocks, $this->expectedMocksCollections);
  
          foreach ($values as $property => $value) {
              if (is_array($value)) {
                  $addMethod = 'add'.ucfirst($property);
                  foreach ($value as $mock) {
                      $this->getObjectToTest()->$addMethod($mock);
                  }
              } else {
                  if ($accessor->isWritable($this->getObjectToTest(), $property)) {
                      // Use direct access to property to avoid "only variables should be passed by reference"
                      $accessor->setValue($this->objectToTest, $property, $value);
                  }
              }
          }
  
          // Tear down
          unset($values);
          unset($accessor);
  
          return $this;
      }
code: protected function bindExpectedToObject()
      {
          $accessor = PropertyAccess::createPropertyAccessor();
  
          $values = array_merge($this->expectedValues, $this->expectedMocks, $this->expectedMocksCollections);
  
          foreach ($values as $property => $value) {
              if (is_array($value)) {
                  $addMethod = 'add'.ucfirst($property);
                  foreach ($value as $mock) {
                      $this->getObjectToTest()->$addMethod($mock);
                  }
              } else {
                  if ($accessor->isWritable($this->getObjectToTest(), $property)) {
                      // Use direct access to property to avoid "only variables should be passed by reference"
                      $accessor->setValue($this->objectToTest, $property, $value);
                  }
              }
          }
  
          // Tear down
          unset($values);
          unset($accessor);
  
          return $this;
      }
code_tokens: protected function bindExpectedToObject ( ) { $ accessor = PropertyAccess :: createPropertyAccessor ( ) ; $ values = array_merge ( $ this -> expectedValues , $ this -> expectedMocks , $ this -> expectedMocksCollections ) ; foreach ( $ values as $ property => $ value ) { if ( is_array ( $ value ) ) { $ addMethod = 'add' . ucfirst ( $ property ) ; foreach ( $ value as $ mock ) { $ this -> getObjectToTest ( ) -> $ addMethod ( $ mock ) ; } } else { if ( $ accessor -> isWritable ( $ this -> getObjectToTest ( ) , $ property ) ) { // Use direct access to property to avoid "only variables should be passed by reference" $ accessor -> setValue ( $ this -> objectToTest , $ property , $ value ) ; } } } // Tear down unset ( $ values ) ; unset ( $ accessor ) ; return $ this ; }
docstring: Automatically set the properties of the Resource with expected values.
  
  @return $this
docstring_tokens: Automatically set the properties of the Resource with expected values .