Talking Drupal: Skills Upgrade #7
Welcome back to “Skills Upgrade” a Talking Drupal mini-series following the journey of a D7 developer learning D10. This is episode 7.
Topics-
Review Chad's goals for the previous week
- Test Example
- Set up phpunit.xml
- Start with FrontPageLinkTest.php
-
Review Chad's questions
- In the testing_example module, the file "src/Controller/TestingExampleController.php" has a function for simpletestDescription(). Is this an outdated artifact that should have been removed at some point? The module itself doesn't appear to use Simpletest elsewhere and appears to only rely on PHPUnit.
- What do you recommend for the minimal code structure to include for any given test type? Is the Testing Example module an ideal model or are there other resources I should review? The testing reference from Selwyn was helpful.
- In the "FrontPageLinkDependenciesTest.php" setUp() function, the createContentType() function is called without specifying the type. Is that set somewhere else? I may have overlooked it. Nevermind—it's set using randomMachineName() in the createContentType() function. Is there anything extra or standard to write in tests for drupal.org?
-
Tasks for the upcoming week
- Smart Date - Martin (maintainer) to review promptly, I've already chatted with him about it. Create a new functional test: "submit a range with an end time before the start and validate that an error is returned"
- Create an issue in the Smart Date queue and assign to yourself.
- Create an issue fork.
- Check out the issue fork locally.
- Write (and test) the test locally.
- Commit and push to the issue fork.
- Mark issue as "Needs review".
- Ask someone to review - if all looks good, the reviewer will mark as RBTC.
- Smart Date - Martin (maintainer) to review promptly, I've already chatted with him about it. Create a new functional test: "submit a range with an end time before the start and validate that an error is returned"
Chad's Drupal 10 Learning Curriclum & Journal Chad's Drupal 10 Learning Notes
The Linux Foundation is offering a discount of 30% off e-learning courses, certifications and bundles with the code, all uppercase DRUPAL24 and that is good until June 5th https://training.linuxfoundation.org/certification-catalog/
HostsAmyJune Hineline - @volkswagenchick
GuestsChad Hester - chadkhester.com @chadkhest Mike Anello - DrupalEasy.com @ultimike
Balint Pekker: Enhancing Drupal with GitHub Actions
Chapter Three: National Nurses United: Supporting a Large Website
The Drop Times: A Detailed Review of Droopler 4 with Grzegorz Bartman of Droptica
Drupal Association blog: 5 Reasons to Join Us at DrupalCon Portland 2024
Discover Why DrupalCon Portland 2024 Is the Must-Attend Event of the Year
If you're part of the Drupal community or interested in Drupal, you won't want to miss DrupalCon Portland 2024! The conference is set to be the most exciting and informative event of the year, catering to developers, marketers, content editors, content publishers, and anyone else who interacts with their website. In this blog post, I'll outline the top five reasons why attending DrupalCon Portland in 2024 is a must.
Immerse Yourself in the Ultimate Drupal Experience
DrupalCon Portland 2024 promises an entire week dedicated to Drupal and the vibrant Drupal Community. It's your chance to connect with some of the most brilliant minds in the industry, engage in discussions, build lasting friendships, and simply have a fantastic time. Key highlights of the event include:
-
Foster Community Through In-Person Connections: Experience the warmth and synergy of the Drupal community by connecting face-to-face with fellow Drupal enthusiasts. This is a unique chance to share your passion for Drupal with like-minded individuals in a vibrant, engaging setting.
-
Driesnote & Eminent Speakers: Gain insights from the Drupal founder during the much-anticipated Driesnote and learn from a lineup of distinguished speakers. These sessions promise to be thought-provoking, offering deep dives into various aspects of Drupal, its ecosystem, and future directions.
-
Contribution Opportunities: Participate in contribution sprints where you can tackle real-world problems, contribute to the project, and interact with key project contributors and maintainers. This is your chance to make a tangible impact and glean insights from the guardians of the Drupal codebase.
-
Social Gatherings and Welcome Party: DrupalCon isn't just about learning; it's also about having a great time. The Welcome Party and other social events provide perfect settings to unwind, celebrate, and build friendships in a more relaxed atmosphere. View the social events or submit yours now.
-
Birds of a Feather Sessions: Engage in "Birds of a Feather" (BoF) sessions, where small groups gather to discuss hot topics and share knowledge on specific areas of interest within Drupal and technology. These small gatherings encourage open dialogue and are a great way to dive deep into subjects you care about with peers.
Rediscover the Thriving Drupal Community
After years of remote work and lockdowns, DrupalCon Portland 2024 provides a refreshing opportunity to step out of your home office and connect with passionate Drupal enthusiasts. Meet the faces behind your favorite modules and engage with like-minded individuals who share your love for Drupal.
Unparalleled Learning Opportunities
DrupalCon offers unparalleled opportunities for learning and growth. From inspiring keynotes and informative sessions to hands-on training and contribution sprints, this event is the ultimate platform to expand your knowledge and expertise. Break out of your routine and explore the full potential of Drupal.
This year will be filled with broader topics to help you drive your digital experiences forward. Some of the new highlights this year include:
- A new marketing track dedicated to driving your business goals forward.
- Artificial Intelligence (AI) - Learning how AI is being incorporated into Drupal and how it can help you improve your day to day and achieve your goals.
- Birds of a Feather - More structure and planning going into our BOF sessions to drive higher levels of engagement and inform stronger conversations.
Be Inspired by Innovations
Witness the transformative power of Drupal and be inspired by the innovative and talented Drupal community. Attendees at DrupalCon Portland are focused on:
- Crafting cutting-edge content management systems.
- Delivering groundbreaking customer experiences.
- Mastering their craft and pushing boundaries.
Forge Valuable Connections
DrupalCon Portland is the perfect environment to connect with individuals who share your passion for Drupal, open-source technology, and delivering top-notch digital experiences. Building relationships here can significantly impact your career, opening doors to exciting opportunities.
There are countless reasons to join us at DrupalCon Portland 2024, and we can't wait to welcome you! It's a unique opportunity to connect with the Drupal community, discover the incredible work happening within Drupal, and spend quality time with friends and colleagues from around the world who share your common passion. We look forward to seeing you there!
Matt Glaman: Writing tests first saves time and money later on
The TalkingDrupal podcast had Alexey Korepov on to talk about Test Driven Development. Alexey has written the Test Helpers module, a development package that provides many useful utility tools for writing unit tests for your Drupal code.
Specbee: How to integrate Auth0 Single Sign-On (SSO) in Drupal
Talking Drupal: Talking Drupal #446 - Test Driven Development
Today we are talking about Test Driven Development, Why it’s important, and How it improves development with guest Alexey Korepov. We’ll also cover Test Helpers as our module of the week.
For show notes visit: www.talkingDrupal.com/446
Topics- What does the term Test Driven Development (TDD) mean
- Does Drupal make use of TDD
- What makes TDD different from other methods of Development
- Do you have to change your way of thinking
- What are some good resources to learn TDD
- Do you have any pointers for teams looking to get started
- Are certain kinds of projects better suited to TDD
- How have dev teams adapted to TDD
- Any advice on environment setup
- Any special tools
- Open telemetry
- QA Engineer
- Kent Beck Test Driven Development: By Example
- Needs tests tag
- Local unit tests
- PHPUnit
Alexey Korepov - korepov.pro Murz
HostsNic Laflin - nLighteneddevelopment.com nicxvan Martin Anderson-Clutz - mandclu Matt Glaman - mglaman.dev mglaman
MOTW CorrespondentMartin Anderson-Clutz - mandclu
- Brief description:
- Have you ever wanted an API that could dramatically simplify the process of writing Drupal unit tests? There’s a module for that.
- Module name/project name:
- Brief history
- How old: created in Sep 2022 by today’s guest, Alexey Korepov
- Versions available: 1.3.0 compatible with versions of Drupal 9.4 or newer, right up to Drupal 11
- Maintainership
- Actively maintained, latest release less than 3 months ago
- Security coverage
- Test coverage, would be ironic if it didn’t
- API Documentation is available, linked from the project page
- Number of open issues: 2 open issues, which are actually feature requests
- Usage stats:
- 5 sites officially, but modules or sites can leverage Test Helpers without enabling it, and this usage is recommended, so the number is actually higher
- Module features and usage
- Provides a new container that automated tests can leverage to perform common tasks with much less code.
- For example, you can create a user or a node with a single line of code
- You can also mock more complex operations like an entityQuery or loadMultiple call, again with a single line of code
- Traditionally, writing unit tests is more complicated because by design they run without fully bootstrapping Drupal
- That means that your test needs to mock functions or services in the code you’re testing which can result in units tests being much longer than the code they’re testing
- Test Helpers also allows your tests to leverage existing mocks and stubs for popular services
- The project page also links to the recording and slides for a talk Alexey gave about Test Helpers at DrupalCon Pittsburgh last year, if you want to do a deeper dive