Midwest Dev Chat

MidwestDevChat.com github.com/skidvis/Midwest-Dev-Chat

  • The newest 15 messages in the super-cool #php channel.

  • 03/15 18:21:44 Fatima: I have `require_once ‘PHPUnit/Autoload.php’;` but it keeps giving me `PHP Warning: require_once(PHPUnit/Autoload.php): failed to open stream…`

  • 03/15 22:06:43 Leonardo: Paging @Conner!

  • 03/15 22:15:00 Conner: @Fatima Are you using composer? Is `phpunit/phpunit` in your “require-dev” section?

  • 03/15 22:18:54 Conner: Basically, if you use composer, you can make your use of PHPUnit (and all other libraries for that matter) much easier to implement. For PHPUnit, point your “bootstrap” section in `phpunit.xml` to “vendor/autoload.php”. Examples: https://github.com/ericpoe/haystack/blob/master/phpunit.xml.dist> and

  • 03/15 22:21:57 Arielle: composer++

  • 03/15 22:21:59 Conner: Then you won’t need a `require_once ‘PHPUnit/Autoload.php’;` or similar in your unit tests

  • 03/15 22:33:26 Conner: Here are a couple of light video intros to composer and autoloading in case you aren’t familiar with them. https://laracasts.com/series/php-for-beginners/episodes/21> and

  • 03/15 22:33:50 Conner: Nice explanation on PHP The Right Way: http://www.phptherightway.com/#composer_and_packagist

  • 03/16 09:27:46 Fatima: Thanks @Conner! I'll take a look at those. I'm not using composer with this project, I'm actually just trying to follow along with a pluralsight course https://app.pluralsight.com/library/courses/automated-tests-phpunit/. She just extends the `PHPUnit_Framework_TestCase` class without any mention of installing or autoloading...wondering if I missed something but I don't think I did

  • 03/22 10:50:04 Arielle: So I'm doing some drupal stuff for a friend and I'm out of my comfort zone here. I've got this content type with a handful of fields. When a user adds an entry I've got a hook running that calculates a whole bunch of data based on their input but I can't figure out how to save this data back on the node so it can be looked up later.

  • 03/22 10:51:35 Birdie: has joined the channel

  • 03/22 13:48:07 Arielle: so I ended up making a custom field that stores the the results json_encoded in a large text field with a custom formatter to decode it and turn it into a table

  • 03/22 13:49:46 Yasmeen: Nice @Arielle

  • 03/22 13:50:59 Arielle: thanks

  • 03/22 13:51:11 Arielle: It feels like a hack but I don't know what else to do lol

  • *Usernames have been changed to protect the innocent.

Check out all the cool channels!

Join the conversation!